In the binary search routine in the text, the first thing the code does is to check whether the object is not in the array. What is the test for this condition?

a) first < last
b) first == last
c) first > last
d) the test does not involve the variables first and last.


c) first > last

a) With arrays increasing sorted, while first < last, there are still a subarray where elements must be considered. b) when the first == last there is still one element that must be examined, so this also is the test for the target not being in the array. d) is nonsense.

Computer Science & Information Technology

You might also like to view...

A(n) ____ is information that a Web server stores on a client computer, such as the client's preferences when accessing a particular Web site, or where the client has been on the Web site.

A. applet B. cookie C. scanner D. listener

Computer Science & Information Technology

The keyboard shortcut for quickly saving files is ________

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

Computer Science & Information Technology

What should you use if you wish to execute two or more statements conditionally?

A. A switch statement. B. A block enclosed within a pair of curly braces. C. A defined sequence structure. D. A declared decision structure.

Computer Science & Information Technology

To create an update query, create a new query and then click the ____ button on the Design tab.

A. Query Type B. Action C. Update D. Data Definition

Computer Science & Information Technology