Linear probing hashing: search
(Pascal version available)
int search( key, r )
typekey key; dataarray r;
{ int i, last;
i = hashfunction( key ) ;
last = (i+n-1) % m;
while ( i!=last && !empty(r[i]) && r[i].k!=key )
i = (i+1) % m;
if (r[i].k==key) return( i );
else return( -1 );
}