Insert(T,x) ; x = pointer to new node p = NIL n = root(T) ; Search for key while n <> NIL p = n if key(x) < key(n) then n = left(n) else n = right(n) Parent(x) = p ; Insert new key if p = NIL then root(T) = x else if key(x) < key(p) then left(p) = x else right(p) = x
Insert is O(h)