1.

Which of the following sorting algorithm has best case time complexity of O(n^2)?(a) bubble sort(b) selection sort(c) insertion sort(d) stupid sortThis question was posed to me in semester exam.This interesting question is from Recursion topic in section Recursion of Data Structures & Algorithms II

Answer»

Correct choice is (b) selection SORT

For explanation: Selection sort is not an adaptive sorting algorithm. 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