Data structures & Algorithms MCQ Set 5
1. Which
of the following sorting procedures is the slowest?
A. Quick
sort
B. Heap
sort
C. Shell
sort
D. Bubble
sort
2. Two main measures for the efficiency of an
algorithm are
A. Processor
and memory
B. Complexity
and capacity
C. Time
and space
D. Data
and space
3. The
space factor when determining the efficiency of algorithm is measured by
A. Counting
the maximum memory needed by the algorithm
B. Counting
the minimum memory needed by the algorithm
C. Counting
the average memory needed by the algorithm
D. Counting
the maximum disk space needed by the algorithm
4. The
time factor when determining the efficiency of algorithm is measured by
A. Counting
microseconds
B. Counting
the number of key operations
C. Counting
the number of statements
D. Counting
the kilobytes of algorithm
5. A
list of n strings, each of length n, is sorted into lexicographic order using
the merge-sort algorithm. The worst case running time of this computation is
A. O
(n log n)
B. O
(n2 log n)
C. O
(n2 + log n)
D. O
(n2)
6. Which
of the following case does not exist in complexity theory?
A. Best
case
B. Worst
case
C. Average
case
D. Null
case
7. The
concept of order Big O is important because
A. It
can be used to decide the best algorithm that solves a given problem
B. It
determines the maximum size of a problem that can be solved in a given amount
of time
C. It
is the lower bound of the growth rate of algorithm
D. Both
A and B
8. The
recurrence relation capturing the optimal execution time of the Towers of Hanoi
problem with n discs is
A. T(n)
= 2T(n - 2) + 2
B. T(n)
= 2T(n - 1) + n
C. T(n)
= 2T(n/2) + 1
D. T(n)
= 2T(n - 1) + 1
9. Which
of the following sorting methods would be most suitable for sorting a list
which is almost sorted?
A. Bubble
Sort
B. Insertion
Sort
C. Selection
Sort
D. Quick
Sort
.
10. 60.
Suppose we are sorting an array of eight integers using some quadratic sorting
algorithm. After four iterations of the algorithm’s main loop, the array
elements are ordered as shown here:
2 4 5 7 8 1 3 6
A. Insertion
sort
B. Selection
sort
C. Either
of a and b
D. None
of the above
Answers
1.d
2.c
3.a
4.b
5.a
6.d
7.a
8.d
9.b
10.a
0 comments:
Post a Comment