next up previous
Next: Jump Search Up: No Title Previous: No Title

SEARCHING ON A SORTED LIST

Problem: Given a list tex2html_wrap_inline152 containing
keys such that tex2html_wrap_inline154 , for tex2html_wrap_inline156 .
Problem is to find out if a given x is in L.

I. Use sorted property on sequential search
Quit search as soon as x is less than L[i] and declare that tex2html_wrap_inline166
Could be shown that

displaymath150

W(n) is still O(n).





Sushil Prasad
Thu May 13 13:13:06 EDT 1999