Write a procedure that checks if an element t : Tis present in an ordered tree (as described above).
if root = null then begin
..t is not in the tree end else begin x := root ; if t < val [x] then begin {left [x] <> null} I x := left [x]; end else begin {t > val [x], right [x] <> null} x := right [x]; end; end; end; |