Write a C program to find the height of a binary tree. In the below binary tree the height is 2 [The Height of binary tree with a single node is considered as 0, and with two node is 1]. code example
Example: height of a binary tree
int height(Node* root)
{
// Base case: empty tree has height 0
if (root == nullptr)
return 0;
// recur for left and right subtree and consider maximum depth
return 1 + max(height(root->left), height(root->right));
}