[prev] [index] [next]

Trees (cont)

Search trees have the properties
  • all values in left subtree are less than root
  • all values in right subtree are greater than root
  • this property applies over all nodes in the tree
Balanced trees have the properties
  • #nodes in left subtree = #nodes in right subtree
  • this property applies over all nodes in the tree
We focus on binary search trees or BSTs