Binary Search Tree

The tree illustrated below is a special binary tree called binary search tree

In a binary search tree, for any node,

  1. all the values in its left subtree are smaller than that value.
  2. all the values in its right subtree are larger than that value.

The property described above is often referred to as the complete ordering property of BSTs.

Exercise Which of the following trees are Binary Search Tree?

Solution

(B) is the correct answer!

Resources