1.

What is the average case complexity of selection sort?(a) O(nlogn)(b) O(logn)(c) O(n)(d) O(n^2)This question was addressed to me during an online interview.Origin of the question is Selection Sort topic in section Sorting of Data Structures & Algorithms II

Answer» CORRECT choice is (d) O(n^2)

The EXPLANATION is: In the average CASE, even if the input is partially sorted, selection sort behaves as if the ENTIRE array is not sorted. Selection sort is insensitive to input.


Discussion

No Comment Found

Related InterviewSolutions