Binary search tree: find

From Algowiki
Revision as of 22:05, 19 September 2014 by Jhohmann (talk | contribs)
Jump to navigation Jump to search
TREE-SEARCH (x, k)
if x= NIL or k = key[x]
then return x
if k < key[x]
then return TREE-SEARCH(left[x], k)
else return TREE-SEARCH(right[x], k)