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. |
Which of the following examples represent the worst case input for an insertion sort? |
| A. | array in sorted order |
| B. | array sorted in reverse order |
| C. | normal unsorted array |
| D. | large array |
| Answer» C. normal unsorted array | |
| 2. |
For the best case input, the running time of an insertion sort algorithm is? |
| A. | Linear |
| B. | Binary |
| C. | Quadratic |
| D. | Depends on the input |
| Answer» B. Binary | |
| 3. |
Which of the following sorting algorithms is the fastest for sorting small arrays? |
| A. | Quick sort |
| B. | Insertion sort |
| C. | Shell sort |
| D. | Heap sort |
| Answer» C. Shell sort | |
| 4. |
Which of the following options contain the correct feature of an insertion sort algorithm? |
| A. | anti-adaptive |
| B. | dependable |
| C. | stable, not in-place |
| D. | stable, adaptive |
| Answer» E. | |
| 5. |
Binary search can be used in an insertion sort algorithm to reduce the number of comparisons. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 6. |
In C, what are the basic loops required to perform an insertion sort? |
| A. | do- while |
| B. | if else |
| C. | for and while |
| D. | for and if |
| Answer» D. for and if | |
| 7. |
Which of the following real time examples is based on insertion sort? |
| A. | arranging a pack of playing cards |
| B. | database scenarios and distributes scenarios |
| C. | arranging books on a library shelf |
| D. | real-time systems |
| Answer» B. database scenarios and distributes scenarios | |
| 8. |
For the following question, how will the array elements look like after second pass?34, 8, 64, 51, 32, 21 |
| A. | 8, 21, 32, 34, 51, 64 |
| B. | 8, 32, 34, 51, 64, 21 |
| C. | 8, 34, 51, 64, 32, 21 |
| D. | 8, 34, 64, 51, 32, 21 |
| Answer» E. | |
| 9. |
What will be the number of passes to sort the elements using insertion sort?14, 12,16, 6, 3, 10 |
| A. | 6 |
| B. | 5 |
| C. | 7 |
| D. | 1 |
| Answer» C. 7 | |
| 10. |
What is the running time of an insertion sort algorithm if the input is pre-sorted? |
| A. | O(N<sup>2</sup>) |
| B. | O(N log N) |
| C. | O(N) |
| D. | O(M log N) |
| Answer» D. O(M log N) | |
| 11. |
What is the average number of inversions in an array of N distinct numbers? |
| A. | N(N-1)/4 |
| B. | N(N+1)/2 |
| C. | N(N-1)/2 |
| D. | N(N-1)/3 |
| Answer» B. N(N+1)/2 | |
| 12. |
Any algorithm that sorts by exchanging adjacent elements require O(N2) on average. |
| A. | True |
| B. | False |
| Answer» B. False | |
| 13. |
What is the average case running time of an insertion sort algorithm? |
| A. | O(N) |
| B. | O(N log N) |
| C. | O(log N) |
| D. | O(N<sup>2</sup>) |
| Answer» E. | |
| 14. |
Which of the following algorithm implementations is similar to that of an insertion sort? |
| A. | Binary heap |
| B. | Quick sort |
| C. | Merge sort |
| D. | Radix sort |
| Answer» B. Quick sort | |