Algorithm findSmallestBST (root)
..This algorithm finds the smallest node in a BST.
..Pre root is a pointer to a nonempty EST or subtree.
..Return address of smallest node.
..1 set current to root
..2 loop (while current left sub-tree is not empty)
......1 set current to the left sub-tree
..3 end loop
..4 return current
end findSmallestBST
Comments
Leave a comment