GATE / CS ARCHIVE

GATE CSE 2007 / QUESTION 13

Three-node binary-tree shapes

Data Structures · Tree Properties & Traversals · Full GATE CSE 2007 paper

GATE 2007, Q13 1 mark · MCQ
Report issue

Tree Properties & Traversals

Question 13, GATE 2007: How many different binary trees can be formed using three unlabeled nodes?
Options:
(A) 1
(B) 5
(C) 4
(D) 3
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. Approach. Distinguish left and right child positions. There are four three-node chains (LL, LR, RL, RR) and one root with two children.

2. Derivation and interpretation. For ordered binary trees, let T(0)=1 and T(n)=sum T(i)T(n−1−i). Then T(1)=1,T(2)=2 and T(3)=2+1+2=5, B. Left and right child positions are distinguished, as in the standard binary-tree convention; unlabeled does not mean unordered.

Original paper, page 3