# Algorithm multiple choice questions part-3

## Algorithm MCQs:-

1. Which sorting algorithm has the best worst-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: d) Merge Sort

2. Which sorting algorithm has the best average-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: e) Quick Sort

3. Which sorting algorithm has the best best-case time complexity? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: c) Insertion Sort

4. What is the minimum number of swaps required in Bubble Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

5. What is the maximum number of swaps required in Bubble Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Î˜(n2)

6. What is the minimum number of swaps required in Selection Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

7. What is the maximum number of swaps required in Selection Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: b) Î˜(n)

8. What is the minimum number of swaps required in Insertion Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

9. What is the maximum number of swaps required in Insertion Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Î˜(n2)

10. What is the minimum number of swaps required in Quick Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: a) 0

11. What is the maximum number of swaps required in Quick Sort? a) 0 b) Î˜(n) c) Î˜(n2) d) O(nlgn) e) Is not in-place sorting Answer: c) Î˜(n2)

12. Which sorting algorithm is not an in-place sorting algorithm? a) Bubble Sort b) Selection Sort c) Insertion Sort d) Merge Sort e) Quick Sort Answer: d) Merge Sort

13. What is the time complexity of Linear Search in the worst case? a) Î˜(n) b) Î˜(n2) c) Î˜(nlgn) d) O(n) e) O(logn) Answer: a) Î˜(n)

14. What is the time complexity of Linear Search in the average case? a) Î˜(n) b) Î˜(n2) c) Î˜(nlgn) d) O(n) e) O(logn) Answer: a) Î˜(n)

Pre  ðŸ‘ˆ                                ðŸ‘‰  Next