[Home]
[Contents]
[Chapter]
[Previous Algorithm]
[Next Algorithm]


Separate chaining hashing: search


datarecord *search( key, r ) typekey key; dataarray r; { datarecord *p; p = &r[ hashfunction(key) ]; while ( p!=NULL && key!=p->k ) p = p->next; return( p ); }

C source (3311.srch.c)



© Addison-Wesley Publishing Co. Inc.