static Object hash_find(HashHeader ht, int key) { HashLink scan = null; //scan = ht.Buckets[HashKey(ht, key)]; while (scan != null && scan.Key != key) { scan = scan.Next; } return(scan != null ? scan.Data : null); return(null); }
Object HashRemove(HashHeader ht, int key) { HashLink scan = null; // scan = ht.Buckets + HashKey(ht, key); while (scan != null && (scan).Key != key) { scan = (scan).Next; } if (scan != null) { //HashLink temp = null; HashLink aux; int i = 0; //temp = (HashLink)( scan ).Data; aux = scan; scan = aux.Next; aux = null; //for( i = 0; i < ht.Klistlen; i++ ) // if (ht.Keylist[i] == key) // break; if (i < ht.Klistlen) { //memmove( ht.Keylist + i, ht.Keylist + i + 1, ( ht.Klistlen - i ) // * sizeof( ht.Keylist ) ); ht.Klistlen--; } //return temp; } return(null); }