Test Bank—Chapter Five (Algorithms)
Multiple Choice Questions
1. Which of the following is an activity?
A. Algorithm B. Program C. Process
2. Which of the following is a representation?
A. Algorithm B. Program C. Process
3. Which of the following set of instructions defines an algorithm in the formal, strict sense?
A. X = 3 B. X = 3 C. X = 3
while (X < 5): while (X < 5): while (X < 5):
X = X X = X + 1 X = X – 1
4. Which of the following is not a means of repeating a block of instructions?
A. Pretest loop B. Posttest loop C. Recursion D. Assignment statement
5. When searching within the list
Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom
which of the following entries will be found most quickly using the sequential search algorithm?
A. Lewis B. Pat C. Tom
6. When searching within the list
Lewis, Maurice, Nathan, Oliver, Pat, Quincy, Roger, Stan, Tom
which of the following entries will be found most quickly using the binary search algorithm?
A. Lewis B. Pat C. Tom
7. Which of the following lists would not be obtained at some point when applying the insertion sort
algorithm to the list below?
Sylvia
Nancy