hash coding
hash coding
[′hash ‚kōd·iŋ]hash coding
(programming, algorithm)If, when adding a new item, the hash table already has anentry at the indicated location then that entry's key must becompared with the given key to see if it is the same. If twoitems' keys hash to the same value (a "hash collision") thensome alternative location is used (e.g. the next free locationcyclically following the indicated one). For bestperformance, the table size and hash function must betailored to the number of entries and range of keys to beused. The hash function usually depends on the table size soif the table needs to be enlarged it must usually becompletely rebuilt.
When you look up a name in the phone book (for example), youtypically hash it by extracting its first letter; the hashbuckets are the alphabetically ordered letter sections.
See also: btree, checksum, CRC, pseudorandom number,random, random number, soundex.