📌  相关文章
📜  国际空间研究组织 | ISRO CS 2015 |问题 14

📅  最后修改于: 2022-05-13 01:58:04.980000             🧑  作者: Mango

国际空间研究组织 | ISRO CS 2015 |问题 14

一个有十个桶的哈希表,每个桶一个槽,如下图所示。最初使用带有线性探测的散列函数输入符号 S1 到 S7。搜索不存在的项目所需的最大比较次数为


(一) 4
(乙) 5
(三) 6
(四) 3答案:(乙)
解释:

We have to consider different cases to find the maximum number
 of comparisons needed in searching an item that is not present.
If searching starts at 0 index : 3 comparisons will be made at
 index 0, index 1 and finally at index 2 and terminate searching 
when index 2 found empty.
Similarly after checking on different indexes, the maximum number
of comparisons will be required if searching starts from index 8,
as in this case, total 5 comparisons will be made at index 8, 9, 0, 1 and 2.
So, correct option is (B).

这个问题的测验