[prev] 14 [next]

Binary Search Trees (cont)

Level of node = path length from root to node

Height (or: depth) of tree = max path length from root to leaf

[Diagram:Pic/tree-depth.png]

Height-balanced tree:  ∀  nodes: height(left subtree) = height(right subtree) ± 1

Time complexity of tree algorithms is typically O(height)