web 2.0

Site Update

This site will no longer be updated. Please visit ee08.net.tc from now on...















Sunday, May 9, 2010

Experiment No. 9 Hints - DST Lab

Here are some hints that may help you to do the hashing stuff:

(a) To implement linear probing
1. You only need to edit (after copying) the functions Find and Insert to get linear probing working.
2. Some changes have to be made in the while loop of Find function and almost no change in the Insert function.


(a) Collisions
1. For open-addressing, make some changes in the Find function and use the modified Find function in another function which goes through every element of the hash table and counts the collisions by checking how much each element is away from the position it ought to be in.
2. For separate-chaining, use the modified printing function explained in the next step.

(a) Printing the Table
1. For open-addressing, start from the beginning and depending upon the "Info" of the cell, print the appropriate stuff (i.e. Empty or the Value).
2. For separate chaining, you need to have two while loops, one nested in the other. The top one should traverse the cells of hash table and the nested one should traverse the linked lists. Now when it has to traverse linked list (i.e. more than one element is present in it), it means that collisions are there, so use this property to get the no. of collisions as a by-product.

1 comment:

Anonymous said...

Where is ee08codes?????

wake it up guys.....ye dil maaangay more!!!

Post a Comment