Cycle sort is an in-place, unstable comparison sort that is theoretically optimal in terms of the total number of writes it makes to the array being sorted. It works on the idea that the permutation needed to sort the array can be factored into disjoint cycles, each of which can be individually rotated into place, so every element is written to its final position exactly once.
Facts
Time Complexity
Time Complexity (category)Quadratic Time -- O(n^2) 1 Sources
1. Cycle Sort Algorithm (Wikipedia)
Wikipedia infobox: time complexity quadraticQuote, Wikipedia infobox: time complexity quadratic
quadratic
View the Source Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.