MCQOPTIONS
Saved Bookmarks
This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Quick sort is a space-optimised version of ____ |
| A. | Bubble sort |
| B. | Selection sort |
| C. | Insertion sort |
| D. | Binary tree sort |
| Answer» E. | |
| 2. |
Which one of the following sorting algorithm is best suited to sort an array of 1 million elements? |
| A. | Bubble sort |
| B. | Insertion sort |
| C. | Merge sort |
| D. | Quick sort |
| Answer» E. | |
| 3. |
A machine needs a minimum of 200 sec to sort 1000 elements by Quick sort. The minimum time needed to sort 200 elements will be approximately __________ |
| A. | 60.2 sec |
| B. | 45.54 sec |
| C. | 31.11 sec |
| D. | 20 sec |
| Answer» D. 20 sec | |
| 4. |
Consider the Quick sort algorithm which sorts elements in ascending order using the first element as pivot. Then which of the following input sequence will require a maximum number of comparisons when this algorithm is applied on it? |
| A. | 22 25 56 67 89 |
| B. | 52 25 76 67 89 |
| C. | 22 25 76 67 50 |
| D. | 52 25 89 67 76 |
| Answer» B. 52 25 76 67 89 | |
| 5. |
Consider the Quick sort algorithm in which the partitioning procedure splits elements into two sub-arrays and each sub-array contains at least one-fourth of the elements. Let T(n) be the number of comparisons required to sort array of n elements. Then T(n)<=? |
| A. | T(n) <= 2 T(n/4) + cn |
| B. | T(n) <= T(n/4) + T(3n/4) + cn |
| C. | T(n) <= 2 T(3n/4) + cn |
| D. | T(n) <= T(n/3) + T(3n/4) + cn |
| Answer» C. T(n) <= 2 T(3n/4) + cn | |
| 6. |
Quick sort is a stable sorting algorithm. |
| A. | True |
| B. | False |
| Answer» C. | |
| 7. |
The best case behaviour occurs for quick sort is, if partition splits the array of size n into __________ |
| A. | n/2 : (n/2) 1 |
| B. | n/2 : n/3 |
| C. | n/4 : 3n/2 |
| D. | n/4 : 3n/4 |
| Answer» B. n/2 : n/3 | |
| 8. |
Apply Quick sort on a given sequence 7 11 14 6 9 4 3 12. What is the sequence after first phase, pivot is first element? |
| A. | 6 4 3 7 11 9 14 12 |
| B. | 6 3 4 7 9 14 11 12 |
| C. | 7 6 14 11 9 4 3 12 |
| D. | 7 6 4 3 9 14 11 12 |
| Answer» C. 7 6 14 11 9 4 3 12 | |
| 9. |
What is the worst case time complexity of the Quick sort? |
| A. | O(nlogn) |
| B. | O(n) |
| C. | O(n<sup>3</sup>) |
| D. | O(n<sup>2</sup>) |
| Answer» E. | |
| 10. |
Quick sort is a __________ |
| A. | greedy algorithm |
| B. | divide and conquer algorithm |
| C. | dynamic programming algorithm |
| D. | backtracking algorithm |
| Answer» C. dynamic programming algorithm | |