1 1 vote Consider the following nested representation of Binary Trees. $(ABC)$ indicates $B$ and $C$ are left and right subtrees of node $A$ respectively. Note that $B$ and $C$ may be NULL or further nested. Which of the following representation is not a valid Binary tree? (1 2 3) (1 (2 3 4) (5 6 7)) (1 (1 (1 1 1) (1 1 1)) (1 1 1)) (1 (2 3) 4) Data Structures go-ds-1 data-structures binary-tree two-marks + – Arjun 936 views answer comment Share Follow Print 0 reply Please log in or register to add a comment.
1 1 vote in option d we have (2 3).. we do not know which is the middle element and binary tree is not defined for such case in the question. all other options do not have any such case.. maahisingh answered Oct 16, 2016 maahisingh comment Share Follow See 1 comment 1 1 comment reply Sheshang commented Dec 19, 2016 reply Follow flag as in question it is specified that from ABC, only B or C can be null. Now, in (2,3) 2 is root and 3 can be eithe right child or left child of 2 and other child is null. here nowhere mention that tree must have 2 children, so this also a valid binary tree. may be other issue in D option, but not atleast what you have explained 3 3 replyShare Please log in or register to add a comment.
0 0 votes Option D should also be correct as (2 3) means root = 2 , left child= 3 , right child = null so writing (2 3 null) is same as writing (2 3) adeemajain answered Oct 8, 2018 1 flag: ✌ Edit necessary (solar_raven) adeemajain comment Share Follow 0 reply Please log in or register to add a comment.