1.

What will be the best case time complexity of recursive selection sort?(a) O(n)(b) O(n^2)(c) O(log n)(d) O(n log n)I have been asked this question in semester exam.Query is from Recursion topic in portion Recursion of Data Structures & Algorithms II

Answer»

Right choice is (B) O(n^2)

The BEST I can EXPLAIN: Selection sort’s algorithm is such that it finds the INDEX of minimum ELEMENT in each iteration even if the given array is already sorted. Thus its best case time complexity becomes O(n^2).



Discussion

No Comment Found

Related InterviewSolutions