HW – You are to insert all the records below into expandable hash files based on both dynamic and extendible hashing.  For each solution, start with an empty hash structure.  Turn in the assignment for a bucket size of 2.  The hash function being used is K%16. -

Record        Key=K     Pseudokey or Binary H(K)

record1          64                0000

record2          11                1011

record3          33                0001

record4          44                1100

record5          32                0000

record6          17                0001

record7          14                1110

record8          12                1100

record9          25                1011

record10        34                0010

record 11        99                 0011

record 12        50                 0010

record 13        66                 0010

1.Insert all the records into an initially empty dynamic hash structure.

2.Delete all of the items you inserted in problem 1, and do so in the same order you inserted them in.  I.e., delete record 1 first, then record 2, etc.

3.Insert all the records into an initially empty extendible structure.

4.Delete all of the items you inserted in problem 1, and do so in the same order you inserted them in.  I.e., delete record 1 first, then record 2, etc.

 

Note – Just 1 through 4 are the “official homework assignment, to be turned in Tuesday, September 18, 2007, at the beginning of class.

·     (Additional practice – does not need to be turned in) Work 1 through 4 above with a bucket size of 3.

·     (Additional practice – to see aberrant behavior – does not need to be turned in) Hash the values in reverse order.  I.e., hash record 13 first, record 12 next, and so on.

·     (Additional practice – does not need to be turned in) Statically hash the above values into a table of size 16 – a) w/ linear probing b) with quadratic probing