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)单项选择题
A
empty-since-start
B
occupied
C
removed from table
D
empty-after-removal
登录即可查看完整答案
我们收录了全球超50000道真实原题与详细解析,现在登录,立即获得答案。
类似问题
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-Search Consider the following hash table (with linear probing) and a hash function of key % 10. How many list items will be compared for the search operations? (If bucket is empty, then there is no comparison.) HashInsert(newTable, item 25) HashInsert(newTable, item 77) HashInsert(newTable, item 54) HashInsert(newTable, item 84) HashInsert(newTable, item 83) HashSearch(newTable, 75) # ___A___ HashSearch(newTable, 77) # ___B___ HashSearch(newTable, 63) # ___C___ 1: ___A___ 2: ___B___ 3: ___C___
更多留学生实用工具
希望你的学习变得更简单
加入我们,立即解锁 海量真题 与 独家解析,让复习快人一步!