Binary search tree: find

From Algowiki
Revision as of 10:22, 13 September 2014 by Luedecke (talk | contribs) (Created page with ":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)")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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)