How Insertion Order Sets the Height

Ten distinct integer keys are inserted, one at a time and with no rebalancing, into an initially empty binary search tree in this order:


50, 30, 70, 20, 40, 60, 80, 45, 47, 65


Take the height of a tree to be the number of edges on its longest root-to-leaf path, and count one key comparison for each node visited during a search. Give each answer as a whole number.

  • The height of the resulting tree.
  • The largest number of key comparisons a successful search in this tree can need.
  • The height of the tree you would get by inserting the same ten keys in ascending order instead.
  • The minimum possible height of any binary search tree holding ten keys.
Your answers

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Binary Search Trees Questions: