1.

What is the average case time complexity of cycle sort?(a) O(n^2)(b) O(n log n)(c) O(log n)(d) O(n)I got this question at a job interview.I would like to ask this question from Sorting topic in division Sorting of Data Structures & Algorithms II

Answer»

The correct option is (a) O(n^2)

The EXPLANATION is: The average 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