Veterinarian maintains a record book to store details about the pets who undergo treatments. Each pet gets a unique 3 digit identification number. A log is maintained to store the identification number and the pet name. Assume we are inserting the following records to the log
Insert 128 Julie
Insert 338 Cookie
Insert 568 Snowy
Insert 189 Kaluwa
Insert 789 Jimmy
Insert 121
Insert 445 Shaggy
Insert 556 Roxy
i)How does Open Addressing differ from Separate Chaining?
ii)If the collisions are resolved by Separate Chaining, draw the hash table. The values would be inserted according to the given order.
iii)Repeat Part ii where collisions are resolved by Linear probing.
iv)Repeat Part ii where collisions are resolved by Quadric probing.
v)Repeat Part ii where collisions are resolved by Double Hashing. Assume the constant value is 5.
Hint: Step number constant — (key % constant)
Comments
Leave a comment