Successor, Predecessor, Floor and Ceiling

The binary search tree below was built by inserting the keys 41, 20, 65, 11, 29, 50, 91, 26, 32, 55, 72 and 99 in that order. For a value xx that need not be in the tree, the floor of xx is the largest key in the tree that is less than or equal to xx, and the ceiling of xx is the smallest key in the tree that is greater than or equal to xx.


A binary search tree with root 41, left subtree rooted at 20 and right subtree rooted at 65, holding twelve keys on four levels.


Fill in each key. The in-order successor of 32 is , the in-order predecessor of 72 is , the floor of 60 is , and the ceiling of 23 is .

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: