Data structures & Algorithms MCQ Set 6



1.       In quick sort, the number of partitions into which the file of size n is divided by a selected record is
a.       n
b.       n - 1
c.        2
d.       n/2

2.       A sort technique is said to be stable when the original relative order of records with equal keys are retained after sorting.
A.      True
B.      False

3.       The three factors contributing to the sort efficiency considerations are the efficiency in coding, machine run time and the space requirement for running the procedure.
A.      True
B.      False

4.       How many passes are required to sort a file of size n by bubble sort method?
A.      N2
B.      N
C.      N-1
D.      N/2

5.       How many number of comparisons are required in insertion sort to sort a file if the file is sorted in reverse order?
A.      N2
B.      N
C.      N-1
D.      N/2

6.       How many number of comparisons are required in insertion sort to sort a file if the file is already sorted?
A.      N2
B.      N
C.      N-1
D.      N/2

7.       The worst-case time complexity of Quick Sort is________.
A.      O(n2)
B.      O(log n)
C.      O(n)
D.      O(n logn)

8.       The worst-case time complexity of Bubble Sort is________.
A.      O(n2)
B.      O(log n)
C.      O(n)
D.      O(n logn)

9.       The worst-case time complexity of Selection Exchange Sort is________.
A.      O(n2)
B.      O(log n)
C.      O(n)
D.      O(n logn)

10.    The worst-case time complexity of Merge Sort is________.
A.      O(n2)
B.      O(log n)
C.      O(n)

D.      O(n logn)






Answers
1.c
2.a
3.a
4.c
5.a
6.c
7.a
8.a
9.a
10.d

0 comments:

Back to TOP