19.3.2 Q1: An O(n) algorithm is referred to as having a _______ run time.
a. constant
b. linear
c. quadratic
d. negative
19.3.2 Q2: Big O highlights ________ factors and ignores terms that become unimportant with ________ n values.
a. insignificant, low
b. insignificant, high
c. dominant, low
d. dominant, high
19.3.3 Q1: Big O notation is concerned with the growth rate of algorithm run times, so ________.
a. constants are dominant
b. constants are ignored
c. constant terms are emphasized
d. constants with large values are more important than those with low values
19.3.3 Q2: The linear search algorithm runs in ________time.
a. quadratic
b. O(n)
c. constant
d. nonlinear
19.3.4 Q1: The worst case in linear search is that every element must be checked to determine whether the search
key exists, which occurs if the search key ________.
a. is the last array element
b. is not present
c. is the last array element or is not present
d. None of the above.
19.4.1 Q1: Which of the following statements is true?
a. The binary search algorithm is less efficient than the linear search, but it requires that the array be sorted.
b. The binary search algorithm is more efficient than the linear search, but it requires that the array be unsorted.
c. The binary search algorithm is more efficient than the linear search, but it requires that the array be sorted.
d. The binary search algorithm is less efficient than the linear search, but it requires that the array be unsorted.
19.4.1 Q1: Using a binary search, what is the maximum number of comparisons required to find a search key in a
31-element sorted array?
a. 4.
b. 5.