寄托天下
查看: 2154|回复: 1
打印 上一主题 下一主题

[未归类] 关于CS sub里的一个题目 [复制链接]

Rank: 2

声望
0
寄托币
336
注册时间
2007-7-29
精华
0
帖子
3
跳转到指定楼层
楼主
发表于 2009-5-21 15:25:51 |只看该作者 |倒序浏览
原题叙述如下:
A program that checks spelling works in the following way. A hash table has been defined in which each entry is a Boolean variable initialized to false. A hash function has been applied to each word in the dictionary, and the appropriate entry in the hash table has been set to true. To check the spelling in a document, the hash function is applied to every word in the document. And the appropriate entry in the hash table is examined. Which of the following is (are) correct?
I. true means the word was in the dictionary.
II. false means the word was not in the dictionary.
III. Hash table size should increase with document size.
(A) I only (B) II only (C) I and II only (D) II and III only (E) I, II, and III

此题给出答案为B, 理由是word in dictionary->hash tabe set true的逆否命题是II,这个很正确,但是I为什么不对呢,题目已经说好hash table里缺省是false,只有dictionary里的单词映射过去后才设为true,我感觉I.也是对的,大家有什么想法不妨发表一下。
0 0

使用道具 举报

Rank: 1

声望
0
寄托币
22
注册时间
2009-6-1
精华
0
帖子
0
沙发
发表于 2009-6-1 22:28:50 |只看该作者
It is said that confliction might arise when applying the hash function. So (I) is not correct.

使用道具 举报

RE: 关于CS sub里的一个题目 [修改]

问答
Offer
投票
面经
最新
精华
转发
转发该帖子
关于CS sub里的一个题目
https://bbs.gter.net/thread-955272-1-1.html
复制链接
发送
回顶部