Article 2273 of alt.sources:
Path: cos!uunet!snorkelwacker!usc!wuarchive!sdd.hp.com!caen!math.lsa.umich.edu!math.lsa.umich.edu!emv
From: chris@mimsy.umd.edu (Chris Torek)
Newsgroups: alt.sources
Subject: [comp.lang.c] Re: hash function for text in C
Message-ID: <1990Oct18.184451.18734@math.lsa.umich.edu>
Date: 18 Oct 90 18:44:51 GMT
Sender: emv@math.lsa.umich.edu (Edward Vielmetti)
Reply-To: chris@mimsy.umd.edu (Chris Torek)
Followup-To: comp.lang.c
Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742
Lines: 417
X-Original-Newsgroups: comp.lang.c

Archive-name: hash/18-Oct-90
Original-posting-by: chris@mimsy.umd.edu (Chris Torek)
Original-subject: Re: hash function for text in C
Reposted-by: emv@math.lsa.umich.edu (Edward Vielmetti)

[Reposted from comp.lang.c.
Comments on this service to emv@math.lsa.umich.edu (Edward Vielmetti).]

The following implements expanding chained hash tables for strings and
numbers.  This is unmodified from a special-purpose program (having to
do with reading a large number of files with name=id pairs and doing
various operations on them).  Chain lengths are not monitored; instead,
the table is invariably expanded whenever it becomes 2/3 full.  Entries
may be neither removed nor modified.

An essentially-unrelated function called `string' maintains a string
pool such that string(x) == string(y) iff strcmp(x,y)==0 (the program
typically stores each name several times, and often needs to test for
name equality, so this helps there).

