Dec 192017
 
Hash table algorithm - with full C source code.
File HASHTAB.ZIP from The Programmer’s Corner in
Category C Source Code
Hash table algorithm – with full C source code.
File Name File Size Zip Size Zip Type
HASH.C 6291 1880 deflated
HASH.H 1415 616 deflated
NETNOTE.TXT 1508 798 deflated

Download File HASHTAB.ZIP Here

Contents of the NETNOTE.TXT file


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: [email protected] (Chris Torek)
Newsgroups: alt.sources
Subject: [comp.lang.c] Re: hash function for text in C
Message-ID: <[email protected]>
Date: 18 Oct 90 18:44:51 GMT
Sender: [email protected] (Edward Vielmetti)
Reply-To: [email protected] (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: [email protected] (Chris Torek)
Original-subject: Re: hash function for text in C
Reposted-by: [email protected] (Edward Vielmetti)

[Reposted from comp.lang.c.
Comments on this service to [email protected] (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).



 December 19, 2017  Add comments

Leave a Reply