PRASHNIKAप्रश्निका
Back to the paper

Answer the following questions from the diagram of a Binary Tree given below: Write the pre-order…

Computer Science20193 marksShort answer
Answer the following questions from the diagram of a Binary Tree given below:
Figure for this question
(i)[1.0]
Write the pre-order traversal of the above tree structure.
(ii)[1.0]
State the size of the tree.
(iii)[1.0]
Name the siblings of the nodes E and G.

Answer

Answer (i)

AI
Pre-order traversal (Root, Left, Right): A, E, G, I, C, H, B, D, F

Answer (ii)

AI
Size of the tree (total number of nodes) = 9 (nodes A, E, B, G, C, D, I, H, F).

Answer (iii)

AI
Sibling of E = B (both are children of the root A). Sibling of G = C (both are children of E).
Data structures

From ISC 2019 Computer Science Paper 1, question 12(b).