Suppose a phone book contains 500 pages, and each page can contain up to 500 records. Suppose we want to search for a particular name in the book. Give a worst-case bound on the number of pages that must be looked at to perform a search using each of the following methods:

(i) linear search, as if the book were organized as a heap file,
(ii) binary search, using the fact that the book is ordered by names,
(iii) with an index for the name of the rst entry on each page.


500, 9 (=log2500e), 2 (the index has 500 pages, so the entire index fits in one page; so 1 access to the index and 1 to the data).

Computer Science & Information Technology

You might also like to view...

Which of the following expressions has as its value the words "Hello World” surrounded by quotation marks?

(A) "Hello World" (B) Chr(34) & "Hello World" (C) Chr(34) & Hello World & Chr(34) (D) Chr(34) & "Hello World" & Chr(34)

Computer Science & Information Technology

Constant variables also are called .

a. write-only variables b. finals c. named constants d. All of the above

Computer Science & Information Technology

Used in WEP2, ____________________ was developed by the Massachusetts Institute of Technology (MIT) and used to verify the identity of network users.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

A(n) ________ control is a control that does not have a source of data such as the title of the form

A) unbound B) bound C) calculated D) text box

Computer Science & Information Technology