Find the Maximum Depth OR Height of a Binary Tree by SJ · September 19, 2014 Objective: Given a binary tree, find the height of it Input: A Binary Tree Output: Height of a binary tree Example: Approach: Recursion: Get the height of left sub tree, say leftHeight Get the height of right sub tree, say rightHeight Take the Max(leftHeight, rightHeight) and add 1 for the root and return Call recursively. Time Complexity : O(n) Complete Code:Run This Code Output: Height of the Tree is 7 __________________________________________________ Top Companies Interview Questions..- Google Microsoft Amazon Facebook more.. If you find anything incorrect or you feel that there is any better approach to solve the above problem, please write comment. __________________________________________________ Related Posts:Convert binary tree to its Sum treeTop 25 Interview Problems on Binary Trees/Binary Search TreesConvert Binary Tree into Threaded Binary TreeSearch the Element in a binary tree – With and Without RecursionConvert BST to Greater Sum TreeIntroduction to Threaded Binary TreeHeap Sort – Java ImplementationSingle Threaded Binary Tree Complete ImplementationBinary Tree-Inorder Traversal – Non Recursive ApproachBinary Tree – Preorder Traversal – Non Recursive ApproachShare this:LinkedInGooglePrintTumblrFacebookTwitterEmailLike this:Like Loading...