8 8 votes The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree. The maximum possible height of a full binary tree with $23$ nodes is $\_\_\_\_$.(answer in integer) Algorithms gatecse-2026-set1 algorithms binary-tree numerical-answers one-mark + – gatecse 3.8k views answer comment Share Follow Print See all 4 Comments 4 4 Comments reply Jayvijay Chauhan commented May 11 reply Follow flag be careful full bt (0 or 2 child) not complete bt 0 0 replyShare TEJASWINI K commented Jun 4 reply Follow flag must care full with Definion of Perfect and full and Complete ...dont confuse full==all nodes have either 0 child or 2 child .. in question they ask Max height ..So we try increse height as much posiible that meas we try fit minmum posible nodes at every level so each step make one node has zero child and another must have 2child (because if both are 0 Child then tree cant grow ) so this method gives excpet 1st LEVEL i.e root each level we have 2 ...1+11X2=23 height is =11 not 12 (The height of a binary tree is the number of edges in the longest path from the root to a leaf in the tree) 0 0 replyShare Sandy_05 commented Jul 4 reply Follow flag Given:Full binary tree = Every node has either 0 or 2 childrenMax of FBT is possible only when skewedIn a skewed structure Height (defined on terms of edges) = No of Internal nodesSo finding no of internal nodes provides us the answer Total Nodes = No of internal nodes * 2 + 123 = I * 2 + 122 = I * 222/2 = II = 11 0 0 replyShare Sandy_05 commented Jul 12 reply Follow flag FULL BINARY TREE:Min height : \(N = 2^{h+1} - 1\) nodesMax height: \(N = 2h + 1\) nodes 1 1 replyShare Please log in or register to add a comment.
8 8 votes we know that for any binary tree:total number of nodes $n$= internal nodes $(I)$+ leaf node $( L)$In a Full Binary Tree, the number of leaves is always one more than the internal nodes:$L=I+1$Substitute $L$ into the total nodes equation: $n = I + (I + 1) = 2I + 1$now put $n = 23$: $23 = 2I + 1 \implies 22 = 2I \implies I = 11$.To get the maximum height, we should arrange these$11$ internal nodes in a single path (skew tree). Each internal node then contributes exactly 1 edge to the height.Therefore, Max Height = Number of Internal Nodes = 11. Hira Thakur answered Feb 23 • moved Feb 24 by Misbah Ghaya Hira Thakur comment Share Follow 0 reply Please log in or register to add a comment.
6 6 votes Full binary tree : Every node has either 0 or 2 children. Asked for max height for 23 nodes. In exam i drawn this and made the answer without any formula, ofcourse in less than 1 min hope this helps to build your intuition.(start first node with count 1, just count the skewed lines it will be 11.) Mr null answered Feb 23 • moved Feb 24 by Misbah Ghaya Mr null comment Share Follow 0 reply Please log in or register to add a comment.
4 4 votes A full binary tree is a binary tree with either zero or two child nodes for each node.Remove the root and then the problem boils down to make groups of $2$ with $n-1$ elemets, which will be $\frac{(n-1)}{2}$.So ans will be $11$.I don't know why in the exam I thought full BT = complete BT and answered $4$:) gopal_gate answered Feb 23 • moved Feb 24 by Misbah Ghaya gopal_gate comment Share Follow See all 4 Comments 4 4 Comments reply Abdul_Kadir commented Feb 23 reply Follow flag Yep I did same and answered 4 T_T 4 4 replyShare RaizelK commented Feb 26 reply Follow flag same 0 0 replyShare rajveer05chauhan commented Feb 26 reply Follow flag i remebered that dull binary tree has zero child or 2 child so i made a tree but forgot to maximise it by making it skewed , altho i had done a question like this, lesson learnt but at what cost, till now i lost around 6 marks , when i am solving it jhut se but exam mein kya ho gaya bhai, i was not paniking but it was like ki in some question i used all my mental power and was exhausted mentally so tublelight jal nhi rhi thi, alto i gave 15+ mocks 1 1 replyShare Anurag_Gautam 1 commented Mar 7 reply Follow flag same bhai 0 0 replyShare Please log in or register to add a comment.
2 2 votes Prashant-G answered Mar 23 Prashant-G comment Share Follow 0 reply Please log in or register to add a comment.
0 0 votes For a full binary tree:Every node has either 0 or 2 childrenMaximum height occurs when the tree is as “skewed” as possible while still remaining full. A full binary tree with height h has:Minimum nodes = 2h+1(because each internal node contributes exactly one extra leaf) Given: 2h+1=23 2h=22 h=11So the maximum possible height is:11 Siddharth_Perkar answered May 21 Siddharth_Perkar comment Share Follow 0 reply Please log in or register to add a comment.