AQA A Level · Computer Science 7517

雜湊表:练习题

5 道选择题即时批改,另有 5 道文字题附完整解题步骤,全部围绕「雜湊表」。

10 道题目26 免费,无需注册
第 1 题
1

A hash table has 10 slots (indexed 0 to 9) and uses the hash function \(h(k) = k \text{ mod } 10\). If linear probing is used for collision resolution, where will the key 25 be stored if keys 5, 15, and 35 are already in the table in that order?

第 2 题
1

A hash table is implemented using chaining with linked lists to resolve collisions. The hash function is \( h(k) = k \text{ mod } 10 \). If the keys 14, 24, 34, and 44 are inserted into an empty table, what is the time complexity to search for the key 44 in the resulting data structure in the worst-case scenario, assuming the list at each index is not ordered?

第 3 题
1

A hash table with 100 slots uses linear probing. After many insertions and deletions, the table suffers from primary clustering. Which of the following best describes the impact of primary clustering on the table's performance and the most effective way to mitigate it using the syllabus concepts?

第 4 题
1

A hash table is used to store data. If the table currently contains the values 11, 22, and 33 at their hashed indices, and a new value is being inserted that hashes to an index already occupied by 22, what is the term for this occurrence, and which technique involves finding the next available slot?

第 5 题
1

A hash table uses a hash function \(h(k)\). If the load factor \(\alpha\) is defined as \(\frac{n}{m}\) (where \(n\) is the number of entries and \(m\) is the number of slots), which statement regarding collisions is most accurate?

第 6 题
2

A hash table uses the function \( h(k) = k \text{ mod } 11 \). If the keys 12 and 23 are already present, what specific term is used to describe the situation when attempting to insert the key 34?

先自己写一遍答案,再对照解题步骤。

第 7 题
3

A hash table is designed to store exactly 100 items. Explain the specific risk of using a static hash table versus a dynamic hash table in a system where the number of entries frequently exceeds initial estimates.

先自己写一遍答案,再对照解题步骤。

第 8 题
5

Consider a hash table using chaining with linked lists. If the hash function \( h(k) \) maps all keys to the same index, explain the resulting effect on the efficiency of data retrieval.

先自己写一遍答案,再对照解题步骤。

第 9 题
5

A company is designing a new file storage system. They decide to use a hash table of size 13 (indices 0 to 12) with the hash function \( h(k) = k \text{ mod } 13 \).

(a) The following keys are inserted in this order: 25, 38, and 12. State the index for each key.
(b) A fourth key, 51, is now inserted. Explain why a collision occurs and, using linear probing, determine the final index where 51 will be stored.
(c) The developers are considering rehashing. Explain the circumstances under which rehashing would be triggered and how the process is performed.

先自己写一遍答案,再对照解题步骤。

第 10 题
6

A hash table of size 11 (indices 0 to 10) uses the hash function \(h(k) = k \text{ mod } 11\). The table currently contains the following keys:
Index 1: 12
Index 5: 16
Index 6: 28

(a) A new key, 39, is to be inserted. Calculate its initial hash index and describe the collision that occurs.
(b) Using linear probing, determine the final index where 39 will be stored.
(c) Explain the difference between linear probing and chaining as collision resolution strategies.

先自己写一遍答案,再对照解题步骤。

* thinka 提供的内容由 AI 生成,未必在任何情况下都完全准确或最新,请结合官方教材与教师指导使用。

你已看过标准答案。现在轮到你的答案被批改。

这一页能告诉你好答案是什么样子,却无法指出你的答案缺了什么。thinka 按真实评分标准批改你的文字答案,约 15 秒完成。

想多做几道同类题目?立即开始练习这个课题,边做边批改。

立即练习