19 votes 19 votes State whether the following statements are TRUE or FALSE: If the number of leaves in a tree is not a power of $2,$ then the tree is not a binary tree. DS gate1987 data-structures binary-tree true-false + – makhdoom ghaya asked Nov 9, 2016 • recategorized Apr 22, 2021 by Lakshman Bhaiya makhdoom ghaya 4.9k views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply raun220 commented Jul 25, 2019 reply Follow Share No of leaf node =3 i.e not power a power of 2, but it is Binary tree 5 votes 5 votes pritishc commented Jan 4, 2020 reply Follow Share Take contrapositive to make statement simpler - "If the tree is a binary tree, then the number of leaves is a power of 2". This implication can be disproved easily by taking counterexample where number of leaves is not 2-power but the tree is a BT. 0 votes 0 votes Please log in or register to add a comment.
Best answer 25 votes 25 votes Condition for binary tree is atmost two immediate child for every internal node No, it is not the condition for binary tree. Prashant. answered Nov 9, 2016 • edited Jun 13, 2018 by Milicevic3306 Prashant. comment Share Follow See all 0 reply Please log in or register to add a comment.
3 votes 3 votes A binary tree is made of nodes, where each node contains a "left" reference, a "right" reference, and a data element. The topmost node in thetree is called the root. Every node (excluding a root) in a tree is connected by a directed edge from exactly one other node. This node is called a parent. Reference https://www.cs.cmu.edu/~adamchik/15-121/lectures/Trees/trees.html There is no such condition so statement is false Rishi yadav answered Oct 4, 2017 Rishi yadav comment Share Follow See all 0 reply Please log in or register to add a comment.
2 votes 2 votes False. Example: skew binary tree flash12 answered Dec 28, 2017 flash12 comment Share Follow See all 2 Comments See all 2 2 Comments reply Pronomita Dey 1 commented Jan 24, 2018 reply Follow Share Your example always has 1 leaf node, which is a power of two. 5 votes 5 votes talha hashim commented Aug 2, 2018 reply Follow Share your example is not according to question requirement 0 votes 0 votes Please log in or register to add a comment.