We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f4814ba commit 720b7b0Copy full SHA for 720b7b0
Sorts/CycleSort.js
@@ -8,6 +8,12 @@
8
* Wikipedia: https://en.wikipedia.org/wiki/Cycle_sort
9
*/
10
11
+/**
12
+ * cycleSort takes an input array of numbers and returns the array sorted in increasing order.
13
+ *
14
+ * @param {number[]} list An array of numbers to be sorted.
15
+ * @return {number[]} An array of numbers sorted in increasing order.
16
+ */
17
function cycleSort (list) {
18
let writes = 0
19
for (let cycleStart = 0; cycleStart < list.length; cycleStart++) {
0 commit comments