What is the best case and worst-case complexity of selection sort?
Show answerHide answer
Correct answer: (C) O(n²)
Explanation
Selection sort always scans the whole unsorted part to find the minimum, making about n(n−1)/2 comparisons whatever the input order. So both its best and worst cases are O(n²).