Hash
The code illustrated here is the implementation of hash table with
separate chaining.
I use an executable pseudo code (my own language Som). It is a
kind of "assembly language" that is flexible enough to do experiment in
programming for the data structure course easily. Please go to the Som
project page for more information.
My code contains in the package hash.zip
project hash contains:
string.txt
string functions
list.txt
linked list data structure
hash.txt
hash by separate chaining
makehash.txt
makefile of the project
this directory also contains:
sieve.txt
small prime number generator (by sieve of erathothenes)
prime-2000.txt
prime number less than 2000
the compiler tools are (all these files must be presented in the same
directory):
som42a.exe the compiler
som42.obj part of the
compiler
lib2.som
library
for more information about the language see "Som language" in:
www.cp.eng.chula.ac.th/faculty/pjw/
the tools provided here are the latest public release (version 4.2a)
Here is an example of the session, open the "command" windows by "start
-> run cmd" and change to the directory that contains code and
som42a.exe.
to compile the package:
c:>
som42a makehash.txt
once you compile it, the compiler creates an executable object file, to
run it do:
c:>
som42a -x makehash.obj
Enjoy
16 Oct 2009