Coalesced hashing: search


int search( key, r ) typekey key; dataarray r; { int i; i = hashfunction( key ); while ( i!=(-1) && !empty(r[i]) && r[i].k!=key ) i = r[i].next; if ( i==(-1) || empty(r[i]) ) return( -1 ); else return( i ); }

C source (3312.srch.c)



© Addison-Wesley Publishing Co. Inc.