Article View: net.bugs
Article #514ld "bug" (quadratic hashing)
From: Bruce Parker
Date: Wed, 19 Mar 1986 15:20
Date: Wed, 19 Mar 1986 15:20
33 lines
1883 bytes
1883 bytes
Ld claims that quadratic rehash searches only half the
address space. This was observed by Maurer ("An Improved
Hash Code for Scatter Storage", CACM 11:1 (January 1968),
35-38). As a result, 'ld' doubles the symbol table size,
leaving half the entries empty.
However, two years later, Radke showed how to overcome this
difficulty by letting the table size be a prime of the form
4j + 3 for some integer j. As well ld's probe sequence needs
to be modified to use alternate signs:
h(K), h(K) + 1, h(K) - 1, h(K) + 4, h(K) - 4, ...
or more generally
2 2
h(K), h(K) + i , h(K) - i
where 1 <= i <= ( M - 1 ) / 2, where M is the hash table size.
For more details, see "The use of quadratic residue search",
CACM 13:2 (February 1970), 103-105.
Of course, the only benefit of this would be to halve the
symbol table size, so it's not clear that anyone should care
about this. However, it seems sad that most folks who've
taken a decent data structures course in the past 16 years
would know better than to implement quadratic hashing this
way.
Bruce Parker
Computer Science Department (814) 863-0024
107 Whitmore Lab parker@psuvax1.UUCP
The Pennsylvania State University parker@penn-state.CSNET
University Park, Pennsylvania 16802 parker@psuvax1.BITNET
Technical Details
Message-ID:
<2031@psuvax1.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!burdvax!psuvax1!parkerShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site psuvax1.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!bellcore!decvax!ittatc!dcdwest!sdcsvax!sdcrdcf!burdvax!psuvax1!parker From: parker@psuvax1.UUCP (Bruce Parker) Newsgroups: net.bugs Subject: ld "bug" (quadratic hashing) Message-ID: <2031@psuvax1.UUCP> Date: Wed, 19-Mar-86 10:20:44 EST Article-I.D.: psuvax1.2031 Posted: Wed Mar 19 10:20:44 1986 Date-Received: Sat, 22-Mar-86 23:46:24 EST Distribution: net Organization: Pennsylvania State Univ. Lines: 33