0 votes 0 votes Total number of nodes in tree number of leaves The number of edges in the longest path from root to leaf in T The number of nodes in the longest path from root to leaf in T himgta asked Dec 17, 2018 himgta 382 views answer comment Share Follow See all 4 Comments See all 4 4 Comments reply aambazinga commented Dec 17, 2018 reply Follow Share D. base case: if null tree, then returns 0 levels. if only root is there, returns 1, i.e; number of levels for root is 1. further case: if tree having more then 1 level, then it will compute number of levels in left subtree and right subtree and returns 1 + max of those. just have to pick the language-- number of nodes in the longest path from root to leaf, which is nothing but the number of levels. 1 votes 1 votes himgta commented Dec 17, 2018 reply Follow Share i have constructed 2-3 trees but got number of leaves.. can u explain more 0 votes 0 votes aambazinga commented Dec 17, 2018 i edited by aambazinga Dec 17, 2018 reply Follow Share it's written in the 1st line of question itself that a pointer to the root of the BINARY TREE is passed. 0 votes 0 votes himgta commented Dec 17, 2018 reply Follow Share @aambazinga does D means height of the tree? 0 votes 0 votes Please log in or register to add a comment.