42 votes 42 votes Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______. DS gatecse-2015-set3 data-structures binary-tree normal numerical-answers + – go_editor asked Feb 14, 2015 retagged Dec 14, 2023 by Hira Thakur go_editor 23.9k views answer comment Share Follow See 1 comment See all 1 1 comment reply JashanArora commented Oct 5, 2019 reply Follow Share Check: https://gateoverflow.in/8059/gate2015-2-10 2 votes 2 votes Please log in or register to add a comment.
5 votes 5 votes 199 nodes with degree 2. ppm answered Feb 14, 2015 ppm comment Share Follow See all 2 Comments See all 2 2 Comments reply ankurr commented Feb 15, 2015 i edited by ankurr Feb 24, 2015 reply Follow Share ok 1 votes 1 votes ankurr commented Feb 15, 2015 i edited by ankurr Feb 24, 2015 reply Follow Share answer is 199 0 votes 0 votes Please log in or register to add a comment.
4 votes 4 votes Answer is: 199 Because, In Binary Tree, number of leaf nodes is always one more than nodes with two children. L=T+1 where, L=Number of leaf nodes T=Number of internal nodes with two childrens vishalgarg837 answered Nov 24, 2015 vishalgarg837 comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes Using formula for Binary Tree having N Leaf nodes there is N-1 Nodes will have two children.. So here answer will be 199. rpdhakad answered Jul 13, 2015 rpdhakad comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes we know the formula that \ no of leaf nodes= internal_nodes(degree_of_tree - 1)+1 so here given leaf nodes=200 and we know because of 2 children(mentioned in the question) degree is 2 so on putting these value we will get answer 199 200=internal_nodes(2 - 1)+1 so internal nodes=199. nikunj answered Aug 28, 2017 nikunj comment Share Follow See all 0 reply Please log in or register to add a comment.