mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Standard fixes | Cycle Sort
This commit is contained in:
@ -4,7 +4,7 @@
|
||||
* 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
|
||||
* be factored into cycles, which can individually be rotated to give a sorted result.
|
||||
*
|
||||
*
|
||||
* Wikipedia: https://en.wikipedia.org/wiki/Cycle_sort
|
||||
*/
|
||||
|
||||
@ -63,5 +63,5 @@ console.log('\n- Before Sort | Implementation of Cycle Sort -')
|
||||
console.log(array)
|
||||
// After Sort
|
||||
console.log('- After Sort | Implementation of Cycle Sort -')
|
||||
console.log(countingSort(array))
|
||||
console.log(cycleSort(array))
|
||||
console.log('\n')
|
||||
|
Reference in New Issue
Block a user