3 votes 3 votes Suppose you are given a binary tree with n nodes, such that each node has exactly eiter zero or two children. The maximum height of the tree will be $\frac{n}{2}-1$ $\frac{n}{2}+1$ $(n-1)/2$ $(n+1)/2$ DS ugcnetcse-june2016-paper2 data-structures tree + – go_editor asked Aug 16, 2016 • recategorized Nov 4, 2017 by Devshree Dubey go_editor 14.4k views answer comment Share Follow See 1 comment See all 1 1 comment reply smsubham commented Feb 13, 2018 reply Follow Share In GATE question they mention the definition of height. Here nothing is mentioned so maybe we can take the height of level 0 as zero. 0 votes 0 votes Please log in or register to add a comment.
Best answer 5 votes 5 votes Question is about full binary tree.. If it is left or right biased than gives the maximum height... Maximum height is( n-1/ 2) taking root at height 0. papesh answered Aug 16, 2016 • selected Sep 15, 2016 by Sankaranarayanan P.N papesh comment Share Follow See all 2 Comments See all 2 2 Comments reply rishu_darkshadow commented Sep 13, 2017 reply Follow Share but if we take height at 1, ans will be D...so which one is correct ? and why ? plzz clarify me 0 votes 0 votes Prateek Thakral commented Oct 16, 2017 reply Follow Share Height of the tree is equal to largest level of the Tree. 0 votes 0 votes Please log in or register to add a comment.
2 votes 2 votes Given Tree is a strictly binary tree, having either 0 or 2 children such trees always contains odd number of nodes if n=5, then max height will be 2 which is (n-1)/2 if n=7, then max height will be 3 which is again (n-1)/2 So, answer is C Prateek Thakral answered Oct 16, 2017 Prateek Thakral comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes Ans is option C) Ahsanul Hoque answered Aug 7, 2018 Ahsanul Hoque comment Share Follow See all 0 reply Please log in or register to add a comment.