E19 – M Q&A
Which of the following is a way to sort data?
a. Alphabetically.
b. In increasing numerical order.
c. Based on an account number.
d. All of the above. - (correct answer)d
How many comparisons will the linear search algorithm make if the search key is not in
an array of 10 elements?
a. 0.
b. 10.
c. 9.
d. 5. - (correct answer)b
Which of the following is not a name for a big O run time?
a. Constant run time.
b.Variable run time.
c. Linear run time.
d. Quadratic run time. - (correct answer)b
What is the efficiency of linear search?
a. O(1).
b. O(log n).
c. O(n).
d. O(n2). - (correct answer)c
Big O notation describes ________.
, a. the amount of memory required by an algorithm.
b. the difficulty of writing an algorithm to solve a specific problem.
c. an algorithm's efficiency in terms of the work required to solve a problem.
d. the length of an algorithm for solving a specific problem. - (correct answer)c
A searching algorithm that's O(1)________.
a. requires one comparison
b. does not necessarily require only one comparison
c. can search only an array of one item.
d. None of the above. - (correct answer)b
An O(n) algorithm is referred to as having a _______ run time.
a. constant
b. linear
c. quadratic
d. negative
Ans: linear - (correct answer)
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 - (correct answer)d
Big O notation is concerned with the growth rate of algorithm run times, so ________.
a. constants are dominant
Which of the following is a way to sort data?
a. Alphabetically.
b. In increasing numerical order.
c. Based on an account number.
d. All of the above. - (correct answer)d
How many comparisons will the linear search algorithm make if the search key is not in
an array of 10 elements?
a. 0.
b. 10.
c. 9.
d. 5. - (correct answer)b
Which of the following is not a name for a big O run time?
a. Constant run time.
b.Variable run time.
c. Linear run time.
d. Quadratic run time. - (correct answer)b
What is the efficiency of linear search?
a. O(1).
b. O(log n).
c. O(n).
d. O(n2). - (correct answer)c
Big O notation describes ________.
, a. the amount of memory required by an algorithm.
b. the difficulty of writing an algorithm to solve a specific problem.
c. an algorithm's efficiency in terms of the work required to solve a problem.
d. the length of an algorithm for solving a specific problem. - (correct answer)c
A searching algorithm that's O(1)________.
a. requires one comparison
b. does not necessarily require only one comparison
c. can search only an array of one item.
d. None of the above. - (correct answer)b
An O(n) algorithm is referred to as having a _______ run time.
a. constant
b. linear
c. quadratic
d. negative
Ans: linear - (correct answer)
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 - (correct answer)d
Big O notation is concerned with the growth rate of algorithm run times, so ________.
a. constants are dominant