For a hash table with five slots, and using chaining to resolve collisions what does the inserted sequence: 35, 2, 18, 6, 3, 10, 8, 5 look like in the hash table for the hash function h(x) = x % 5?
a. [ (35, 10, 5) , (6), (2), (3,8) , () ]
b. [ (5, 10, 35) , (2,6) , (3,8) , () ]
c. [ (3, 5, 6), (10), (35), () ]
d. [ (3), (5,6), (8, 10), (35) ]
a. [ (35, 10, 5) , (6), (2), (3,8) , () ]
The integers mod 5 each map to 0->35,10,5, 1->6, 2->2, 3->3,8, 4->(). The chaining each element is appended to the end at each slot.
You might also like to view...
When adding a file to an attachment field, the file is actually copied into the database itself
Indicate whether the statement is true or false
When a stack is pushed:
a. The number is entered into the element number in the stack pointer, the stack pointer is then incremented. b. The stack pointer is incremented, then the number is entered into to element number in the stack pointer. c. The number is taken out of the stack at the element number in the stack pointer, the stack pointer is then decremented. d. The stack pointer is decremented, then the number is taken out of the stack at the element number in the stack pointer.