ITPEC FE Subject A April 2026 Question 6

Source exam: ITPEC FE Subject A April 2026Topic: Binary Search Tree

ITPEC FE Subject A April 2026 — Question 6 of 60

Right child of 10 — follow the search path for 11 until it reaches an empty slot.

A new key is always inserted as a leaf at the position the search for it would end:

  • 11 < 14 → go left to 7
  • 11 > 7 → go right to 12
  • 11 < 12 → go left to 10
  • 11 > 10 → go right; that slot is empty, so 11 is inserted there

Answer (d)

Why not others:
- (a) Left child of 16 — 16 sits in the right subtree of 14, but 11 < 14 sends the search left immediately

- (b) Left child of 23 — same problem, and even deeper in the right subtree

- (c) Right child of 3 — reaching 3 requires going left at 7, yet 11 > 7

Key rule: BST insertion never restructures the tree. Compare with each node, descend accordingly, and attach the new value where the search falls off the tree.

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.