原题叙述如下:
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.也是对的,大家有什么想法不妨发表一下。