The GATE Grind

GATE 2015 CS (CS3) – Question 27

Programming and Data Structures · Trees and Binary Search Trees · 1 mark · Multiple choice

Insert 71,65,84,69,67,83 into an empty binary search tree in this order. Which element is at the deepest level?

  1. 65
  2. 67
  3. 69
  4. 83

Practise this question in The GATE Grind →

Show answer and explanation

Correct answer: (B) 67

Explanation

The root is seventy-one. Sixty-five is its left child; sixty-nine becomes the right child of sixty-five; sixty-seven becomes the left child of sixty-nine. On the right, eighty-four has left child eighty-three. The longest root path reaches sixty-seven at depth three, B.

More Trees and Binary Search Trees questions

All Trees and Binary Search Trees questions →