comp.lang.ada
 help / color / mirror / Atom feed
From: mac@ICSC.UCI.EDU.UUCP
Subject: Re: Perfect hash function for Ada keywords
Date: Wed, 14-May-86 15:37:10 EDT	[thread overview]
Date: Wed May 14 15:37:10 1986
Message-ID: <8605141846.AA18967@ucbvax.Berkeley.EDU> (raw)
In-Reply-To: 12206465628.34.HABERLER@SU-SIERRA.ARPA


The first such mention that I know of is a paper in the July,August 1984
issue of Ada Letters called "A Perfect Hash Function for Ada Reserved Words"
by Dave Wolverton.  This function hashes the 63 Ada reserved into 71 
positions.

Robert W. Sebesta and Mark A. Taylor in their article: "Fast Identification
of Ada and Modula-2 Reserved Words" (Journal of Pascal, Ad, and Modula-2,
March/April 1986), improves Wolverton's algorithm by finding a truly perfect
hash for 63 positions.

While Sebesta and Taylor's algorthm is perfect (and minimal in space 
requirements for a hash table), an even faster method could be used where
a table of twice (or three or four times) the size of a perfect table
could be used. While this requires more space, lookup is faster since a
hash to an empty position can be readily determined, whereas a hash to
a filled position requires a string compare.

		-- Greg Finnegan
		   mac@icsc.uci.edu

  reply	other threads:[~1986-05-14 19:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1986-05-13 23:18 Perfect hash function for Ada keywords HABERLER
1986-05-14 19:37 ` mac [this message]
1986-05-16 21:40 ` Jeff Bartlett
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox