next up previous
Next: Generating Probe Sequence Up: CSE 2320: Algorithms and Previous: Pseudocode

Pseudocode

   Search(T,k)
      i = 0
      repeat
         j = h(k,i)
         if T[j] = k
         then return j
         else i = i + 1
      until (T[j] = NIL) or (i = m)
      return NIL



\psfig{figure=figures/f5-4.ps,width=2in,height=3in}



Delete(k,i) is more difficult, because replacement by NIL may break a possible probe sequence.

Solution: replace deleted key by special symbol. However, in this case search time no longer depends on $\alpha$.

Solution: use when deletions are required.



Copyright © 1998 The University of Texas at Arlington