SEPARATE (Binary_Search_Trees_Generic) FUNCTION FindSmallest (T : Tree) RETURN Tree IS ------------------------------------------------------------------------ --| Find Smallest Key in Binary Search Tree --| Author: Michael B. Feldman, The George Washington University --| Last Modified: January 1996 ------------------------------------------------------------------------ -- Pre: T is defined -- Post: returns a pointer to the node of T containing the -- "smallest" value, namely the leaf at the far left side -- of the tree. BEGIN -- FindSmallest IF T = NULL THEN RETURN NULL; ELSIF T.Left = NULL THEN RETURN T; ELSE RETURN FindSmallest(T.Left); END IF; END FindSmallest;