Linear Probing A hash table of length 10 uses open addressing and linear probing with hash function h(k, i)=(k+i) % 10, where k is the key and i is the order of the insertion. After inserting 6 key values into an empty hash table, the resulting table is as shown below. Note that ‘---’ denotes an empty location in the table. Slot # 0 1 2 3 4 5 6 7 8 9 keys --- --- 42 23 4 2 6 33 --- --- Which one of the following is a possible order in which the key values could have been inserted in the table?Single choice
A
4, 42, 23, 2, 33, 6
B
6, 4, 42, 23, 2, 33
C
6, 42, 4, 2, 23, 33
D
None is a correct answer.
E
42, 6, 33, 23, 4, 2
Log in for full answers
We've collected over 50,000 authentic original questions and detailed explanations from around the globe. Log in now and get instant access to the answers!
Similar Questions
Linear Probing Below is a hash table that uses a hash function of key % 10. Starting with an empty table, the following operations are performed on the table. HashInsert(newTable, item 25) HashInsert(newTable, item 54) HashInsert(newTable, item 27) HashInsert(newTable, item 84) HashInsert(newTable, item 83) HashRemove(newTable, 25) Give the bucket number where the following search will end up with after executing the following search operation? HashSearch(newTable, 74) 0 1 2 3 4 5 6 7 8 9 83 54 ghost 84 27
Linear Probing Consider a hash table named idTable that uses linear probing and a hash function of key % 10. Which bucket will 97 be inserted to? HashInsert(idTable, item 97) 0 1 2 3 4 5 6 7 8 9 ??? ??? 92 ??? ??? 45 76 67 78 79
HT-Linear Probing (Search) Given the following hash table and a hash function of key % 10, HashSearch(hashTable, 53) probes __A__ buckets. HashSearch(hashTable, 63) probes __B__ buckets. Note that # probes means the #slots that were visited. 1: __A__ 2: __B__
HT-Linear Probing Consider a hash table named numTable that uses linear probing and a hash function of key % 5. What is the status of bucket 4 after the following operations? (Buckets are numbered as 0, 1,2,3, ...) HashInsert(numTable, item 24) HashInsert(numTable, item 33) HashInsert(numTable, item 51) HashInsert(numTable, item 44) HashInsert(numTable, item 52) HashRemove(numTable, 44) HashInsert(numTable, item 50)
More Practical Tools for Students Powered by AI Study Helper
Making Your Study Simpler
Join us and instantly unlock extensive past papers & exclusive solutions to get a head start on your studies!