Programming - C++ Language

You Are Here :: Home > C++ Language > Arrays - General Questions

 
55.

Consider the following list.
list = {5, 11, 25, 28, 45, 78, 100, 120, 125};
Suppose that a binary search as discussed in the book is used to determine whether 28 is in list. Exactly how many key comparisons are executed by the binary search?                         


A. 6 B. 7
C. 9 D. None of these




56.

Consider the following list.
list = {5, 11, 25, 28, 45, 78, 100, 120, 125};
Suppose that a binary search as discussed in the book is used to determine whether 110 is in list. Exactly how many key comparisons are executed by the binary search?                         


A. 3 B. 5
C. 8 D. None of these




57.

Consider the following list.
list = {5, 11, 25, 28, 45, 78, 100, 120, 125};
Suppose that a binary search as discussed in the book is used to determine whether 28 is in list. What are the values of first and last when the while loop, in the body of the binarySearch function, terminates?                         


A. first = 3, last = 3 B. first = 0, last = 3
C. first = 2, last = 4 D. None of these




58.

Consider the following list.
list = {5, 11, 25, 28, 45, 78, 100, 120, 125};
Suppose that a binary search as discussed in the book is used to determine whether 110 is in list. What are the values of first and last when the while loop, in the body of the binarySearch function, terminates?                         


A. first = 7, last = 6 B. first = 6, last = 6
C. first = 6, last = 6 D. None of these




59.

Suppose that L is a sorted list of length 1000. To determine whether an item is in L, the maximum number of comparisons executed by the binary search algorithm, as discussed in this book, is                         


A. 1 B. 42
C. 500 D. None of these




60.

Consider the following statement.
double alpha[10][5];
The number of components of alpha is                         


A. 15 B. 50
C. 100 D. None of these




« prev

10

11

12

next »

 
 



© 2013 freshersindia.in ® | Copyrights | Terms & Conditions
   Designed by Freshers India
Catch Us on