## MCQ - Sorting in Data Structure

11. 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

12. What is the worst case complexity of selection sort?

A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)

13. 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

14. What is the average case complexity of selection sort?

A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)

15. 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. None of the mentioned

16. 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

17. 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

18.What is the best case complexity of selection sort?

A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)

19. What is an internal sorting algorithm?

A. Algorithm that uses tape or disk during the sort
B. Algorithm that uses main memory during the sort
C. Algorithm that involves swapping
D. Algorithm that are considered ‘in place’

20.What is the worst case complexity of bubble sort?

A. O(nlogn)
B. O(logn)
C. O(n)
D. O(n2)