466 views
1 votes
1 votes

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. (1 2 3)  
  2. (1 (2 3 4) (5 6 7))         
  3. (1 (1 (1 1 1) (1 1 1)) (1 1 1))     
  4. (1 (2 3) 4)

2 Answers

1 votes
1 votes
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..
0 votes
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)

Answer:

Related questions

6 votes
6 votes
5 answers
1
0 votes
0 votes
1 answer
2
Arjun asked Oct 10, 2016
283 views
Consider the array given below:20 10 9 8 7 6 5It isa full binary tree in array representationa complete binary tree in array representationa max-heap in array representat...
1 votes
1 votes
2 answers
3
Arjun asked Oct 10, 2016
764 views
With 5 distinct nodes, the maximum no. of binary trees that can be formed is _____