1.

What is the best case time complexity of cycle sort?(a) O(n^2)(b) O(n)(c) O(n log n)(d) O(1)I got this question in an internship interview.My question comes from Sorting topic in portion Sorting of Data Structures & Algorithms II

Answer»

Right answer is (a) O(n^2)

Easy explanation - Best case time complexity of cycle SORT is O(n^2). This shows that cycle sort is not an adaptive sorting algorithm and thus makes it undesirable when the given array is ALREADY almost SORTED.



Discussion

No Comment Found

Related InterviewSolutions