mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
formatted implementation
This commit is contained in:
@@ -69,5 +69,14 @@ function beadSort (sequence) {
|
|||||||
return sortedSequence
|
return sortedSequence
|
||||||
}
|
}
|
||||||
|
|
||||||
// implementation
|
/**
|
||||||
console.log(beadSort([5, 4, 3, 2, 1]))
|
* Implementation of Cocktail Shaker Sort
|
||||||
|
*/
|
||||||
|
const array = [5, 4, 3, 2, 1]
|
||||||
|
// Before Sort
|
||||||
|
console.log('\n- Before Sort | Implementation of Bead Sort -')
|
||||||
|
console.log(array)
|
||||||
|
// After Sort
|
||||||
|
console.log('- After Sort | Implementation of Bead Sort -')
|
||||||
|
console.log(beadSort(array))
|
||||||
|
console.log('\n')
|
||||||
|
|||||||
Reference in New Issue
Block a user