Could write this code iteratively:
if k < key(n) then n = left(n) else n = right(n) LOOP
Min(n) ; leftmost leaf of tree rooted at n while left(n) <> NIL n = left(n) return n
Max(n) ; rightmost leaf of tree rooted at n while right(n) <> NIL n = right(n) return n