Prashnikaप्रश्निका
Code
About
‹ Back to the paper

Question 11(ii)

3 marks

Computer ScienceISC 2024 Specimen Computer Science Paper 1Case basedData structures

Answer the following questions from the binary tree.

Answer the following questions from the diagram of a Binary Tree given below: Name the external…

Answer the following questions from the diagram of a Binary Tree given below:
(a)[1]
Name the external nodes of the right sub tree.
(b)[1]
State the size and depth of the tree.
(c)[1]
Write the post-order traversal of the above tree structure.
Open in the Binary tree and BST tool

Answer

Answer (a)

The right subtree of the tree is rooted at F and contains the nodes F, G, E, H. Its external (leaf) nodes are E and H (F has child G, and G has children E and H, so only E and H have no children).

Answer (b)

Size of the tree (total number of nodes) = 7 (nodes A, B, D, F, G, E, H). Depth of the tree (number of edges on the longest root-to-leaf path) = 3 (e.g. A -> F -> G -> E, or A -> F -> G -> H).

Answer (c)

Post-order traversal (Left, Right, Root) of the tree: D B E H G F A