The first step performed by the binary search algorithm at each iteration is to:

a. Compare the search key with the lowest element in the current subvector.
b. Compare the search key with the middle element in the current subvector.
c. Compare the search key with the highest element in the current subvector.
d. Count the number of elements in the current subvector.


b. Compare the search key with the middle element in the current subvector.

Computer Science & Information Technology

You might also like to view...

You are given the following statement:Do ... Loop Until intCounter > intNumTimes. The Until intCounter > intNumTimes represents a ____.

A. loop condition B. loop exit condition C. loop full condition D. loop retreat condition

Computer Science & Information Technology

Click the More button in the Chart Layouts group on the ________ tab to view the Chart Layout gallery

A) Layout B) Format C) Insert D) Design

Computer Science & Information Technology

Every time a module is called, the computer suspends execution of the main program, runs the module, and then returns to the next statement in the main program.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology

If currently k=1, the file has two buckets: {bill, mary} and {jane, tony}, and if each bucket can contain at most two records, what happens to k and to the buckets when inserting karl?

Suppose a family of hash functions h k(v)=h(v) mod 2k is used for extendable hashing, and we have the following search key value v and hash function value h(v):

vbill jane karl mary tony
h(v)00010 10111 11001 00010 10101

Computer Science & Information Technology