Data Structures & AlgorithmsHardGATE CS · ICPC regional · Product Company SDE

Keys 56, 66, 31, 58, 79, 72, 35, 77 are inserted in this order into an empty BST. How many leaf nodes does the tree have?

  1. A. 6
  2. B. 1
  3. C. 3
  4. D. 2

Correct answer: C. 3

Build the tree; nodes with no children are leaves: 3 of 8.

More Trees, Graphs, Recursion and Dynamic Programming questions

Exams that ask this topic