This is a homework as you will notice, i have worked on it really much but i think i dont have the enough knowledge of "c" to do it and this is a hard question to ask to a beginner. Thanks to everybody who replies.
i want to construct a hash for a file named CATALOG.Structure of it is:
# of attributes
Attribute info 1
Attribute info 2
Attribute info n
structure of the attribute info is:
Name is a string of 15 characters in length, Type is a field of type char with the possible values of
i for int
l for long
f for float
s for string (at most 15 characters)
c for char
EXAMPLE 'courses.in' file
Math 115 4 John Nash
After building the hash it should be printed into a file named hashex.out
if it contains buckets they will be tab seperated.
hash size: 20 buckets
hash function: key mod 20
the 1st field of the record is an integer and it is taken as the key.
last of all implement selection: select statement will be given in the command prompt
EX: 1.out -s instructor=John Nash
result will be printed in the standard output, each record should be given in a separate line and the fields will be blank seperated.