Binary Trees and Binary Search Trees
A binary tree is either empty or it consists
of three parts:
- A root
- A left subtree which is a binary tree
- A right subtree which is a binary tree
Q: What makes a binary tree a binary search tree?
A: The ordering property:
The root is an element that is:
- greater than or equal to every element
in the left subtree, and
- less than or equal to every element
in the right subtree.