File tree Expand file tree Collapse file tree 1 file changed +7
-7
lines changed
Expand file tree Collapse file tree 1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change 1- /*
2- Wikipedia says: Cycle sort is an in-place, unstable sorting algorithm,
3- a comparison sort that is theoretically optimal in terms of the total
4- number of writes to the original array, unlike any other in-place sorting
5- algorithm. It is based on the idea that the permutation to be sorted can
6- be factored into cycles, which can individually be rotated to give a sorted result.
7- */
1+ /**
2+ * Cycle sort is an in-place, unstable sorting algorithm,
3+ * a comparison sort that is theoretically optimal in terms of the total
4+ * number of writes to the original array, unlike any other in-place sorting
5+ * algorithm. It is based on the idea that the permutation to be sorted can
6+ * be factored into cycles, which can individually be rotated to give a sorted result.
7+ */
88
99function cycleSort ( list ) {
1010 let writes = 0
You can’t perform that action at this time.
0 commit comments