MCQOPTIONS
Saved Bookmarks
This section includes 10 Mcqs, each offering curated multiple-choice questions to sharpen your Data Structures and Algorithms knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What is the best case complexity of selection sort? |
| A. | O(nlogn) |
| B. | O(logn) |
| C. | O(n) |
| D. | O(n2) |
| Answer» E. | |
| 2. |
The given array is arr = {1,2,3,4,5}. (bubble sort is implemented with a flag variable)The number of iterations in selection sort and bubble sort respectively are __________ |
| A. | 5 and 4 |
| B. | 1 and 4 |
| C. | 0 and 4 |
| D. | 4 and 1 |
| E. | The number of iterations in selection sort and bubble sort respectively are __________a) 5 and 4b) 1 and 4c) 0 and 4d) 4 and 1 |
| Answer» E. The number of iterations in selection sort and bubble sort respectively are __________a) 5 and 4b) 1 and 4c) 0 and 4d) 4 and 1 | |
| 3. |
The given array is arr = {3,4,5,2,1}. The number of iterations in bubble sort and selection sort respectively are __________ |
| A. | 5 and 4 |
| B. | 4 and 5 |
| C. | 2 and 4 |
| D. | 2 and 5 |
| Answer» B. 4 and 5 | |
| 4. |
What is the disadvantage of selection sort? |
| A. | It requires auxiliary memory |
| B. | It is not scalable |
| C. | It can be used for small keys |
| D. | It takes linear time to sort the elements |
| Answer» C. It can be used for small keys | |
| 5. |
What is the average case complexity of selection sort? |
| A. | O(nlogn) |
| B. | O(logn) |
| C. | O(n) |
| D. | O(n2) |
| Answer» E. | |
| 6. |
What is the advantage of selection sort over other sorting techniques? |
| A. | It requires no additional storage space |
| B. | It is scalable |
| C. | It works best for inputs which are already sorted |
| D. | It is faster than any other sorting technique |
| Answer» B. It is scalable | |
| 7. |
WHAT_IS_THE_ADVANTAGE_OF_SELECTION_SORT_OVER_OTHER_SORTING_TECHNIQUES??$ |
| A. | It requires no additional storage space |
| B. | It is scalable |
| C. | It works best for inputs which are already sorted |
| D. | It is faster than any other sorting technique |
| Answer» E. | |
| 8. |
What is the worst case complexity of selection sort? |
| A. | O(nlogn) |
| B. | O(logn) |
| C. | O(n) |
| D. | O(n<sup>2</sup>) |
| Answer» E. | |
| 9. |
In the following scenarios, when will you use selection sort? |
| A. | The input is already sorted |
| B. | A large file has to be sorted |
| C. | Large values need to be sorted with small keys |
| D. | Small values need to be sorted with large keys |
| Answer» D. Small values need to be sorted with large keys | |
| 10. |
What is an in-place sorting algorithm? |
| A. | It needs O(1) or O(logn) memory to create auxiliary locations |
| B. | The input is already sorted and in-place |
| C. | It requires additional storage |
| D. | None of the mentioned |
| Answer» B. The input is already sorted and in-place | |