A binary search function receives an array of integers to be searched. The formal parameter for the array is coded as int* list. Which of the following statements properly determines the next mid point to be tested when first and last are pointer variables and mid is an index?
A. mid = first + last - first / 2;
B. mid = (first * last - first) / 2;
C. mid = first + (last - first) / 2;
D. mid = *first + *last - *first / 2;
E. mid = *first + (*last - *first) / 2;
Answer: C
You might also like to view...
A ____________ can display an entire database table in a scroll able grid on an application’s form.
a. Binding Navigator control b. Data Set control c. Chart control d. Data Grid View control
A class can have only one default ____.
A. maker B. creator C. instantiate D. constructor
Internet communications are defined by a set of protocols called TCP/IP. What do TCP and IP stand for, and what is the role of each protocol in transmitting and receiving information?
What will be an ideal response?
The area that holds all of the instructions the computer needs to start up is the RAM
Indicate whether the statement is true or false