Standard fixes | Cycle Sort

This commit is contained in:
marsonya
2021-01-25 23:52:47 +05:30
parent 1626a58b35
commit 9decf7bc7f

View File

@ -4,7 +4,7 @@
* number of writes to the original array, unlike any other in-place sorting * number of writes to the original array, unlike any other in-place sorting
* algorithm. It is based on the idea that the permutation to be sorted can * algorithm. It is based on the idea that the permutation to be sorted can
* be factored into cycles, which can individually be rotated to give a sorted result. * be factored into cycles, which can individually be rotated to give a sorted result.
* *
* Wikipedia: https://en.wikipedia.org/wiki/Cycle_sort * Wikipedia: https://en.wikipedia.org/wiki/Cycle_sort
*/ */
@ -63,5 +63,5 @@ console.log('\n- Before Sort | Implementation of Cycle Sort -')
console.log(array) console.log(array)
// After Sort // After Sort
console.log('- After Sort | Implementation of Cycle Sort -') console.log('- After Sort | Implementation of Cycle Sort -')
console.log(countingSort(array)) console.log(cycleSort(array))
console.log('\n') console.log('\n')