mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
Improved presentation of Implementation | Cycle Sort
This commit is contained in:
@ -53,9 +53,15 @@ function cycleSort (list) {
|
|||||||
}
|
}
|
||||||
return writes
|
return writes
|
||||||
}
|
}
|
||||||
const arrOrignal = [5, 6, 7, 8, 1, 2, 12, 14]
|
|
||||||
// Array before Sort
|
/**
|
||||||
console.log(arrOrignal)
|
* Implementation of Cycle Sort
|
||||||
cycleSort(arrOrignal)
|
*/
|
||||||
// Array after sort
|
const array = [5, 6, 7, 8, 1, 2, 12, 14]
|
||||||
console.log(arrOrignal)
|
// Before Sort
|
||||||
|
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('\n')
|
||||||
|
Reference in New Issue
Block a user