ITPEC FE Morning October 2021 Question 8
ITPEC FE Morning October 2021 — Question 8 of 80
Binary Search Tree (BST) — identify a tree by its structural properties.
BST property: for every node, all keys in the left subtree are less and all keys in the right subtree are greater.
Check the tree (root = 5):
- 5: left 3 < 5 < right 7 ✓
- 3: left 2 < 3 < right 4 ✓
- 7: left 6 < 7 < right 9 ✓
- 2: left 1 < 2 ✓
- 9: right 10 > 9 ✓
Why not others:
- (a) Balanced tree — not balanced; subtree depths differ and the tree is not height-balanced (AVL condition violated)
- (c) Max heap — parent must be ≥ children, but root 5 < children 7, 9
- (d) Min heap — requires a complete binary tree (filled left-to-right level by level); this tree has gaps (e.g., node 2 has only a left child)
Key rule: BST = left < parent < right for every node. Heap = parent ≥ (or ≤) children + complete tree shape.
AI-generated — may contain errors
The original exam layout is preserved in the image so diagrams, formulas, tables, and code remain accurate.
This question comes from an official ITPEC past paper. ITPEC Practice is an independent study tool and is not affiliated with ITPEC. See the official FE past-paper collection or Report an issue.