PadhaikoAll subjects

Past exam question: 2062 Baishakh (Regular / Back), Q4(b)

Data Structure and Algorithms · 6 marks

Open in the Padhaiko app

Topic: Definition and tree terminologies · Binary trees · Binary search tree

Question

Is the given tree in figure is strictly binary tree? Give reason. What is the depth of the given tree? Write the sequences of node in preorder, postorder and inorder traversal.

[figure: binary tree rooted at A; A has left child B and right child E; B has left child C and right child D; E has left child F and right child G; F has left child H and right child I]

Solution

1. Is It a Strictly Binary Tree? Yes. A strictly binary tree (full binary tree) is a binary tree in which every node has either children (leaf) or children (internal node). Here:

No node has only 1 child, so it is a strictly binary tree.

2. Depth (Height) of the Tree:

3. Traversals:

Answer:

All past exam questions for Data Structure and Algorithms