1.

What is the worst case time complexity of cycle sort?(a) O(n)(b) O(log n)(c) O(n log n)(d) O(n^2)This question was posed to me in my homework.Question is from Sorting topic in chapter Sorting of Data Structures & Algorithms II

Answer»

Correct ANSWER is (d) O(n^2)

For explanation: The WORST case performance of CYCLE sort is O(n^2). It is because it has to make n comparisons for each ELEMENT of the array.



Discussion

No Comment Found

Related InterviewSolutions