mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 00:01:37 +08:00
Improved Implementation Presentation | CombSort
This commit is contained in:
@ -42,9 +42,15 @@ function combSort (list) {
|
||||
}
|
||||
return list
|
||||
}
|
||||
const arrOrignal = [5, 6, 7, 8, 1, 2, 12, 14]
|
||||
// Array before Sort
|
||||
console.log(arrOrignal)
|
||||
const arrSorted = combSort(arrOrignal)
|
||||
// Array after sort
|
||||
console.log(arrSorted)
|
||||
|
||||
/**
|
||||
* Implementation of Comb Sort
|
||||
*/
|
||||
const array = [5, 6, 7, 8, 1, 2, 12, 14]
|
||||
// Before Sort
|
||||
console.log('\n- Before Sort | Implementation of Comb Sort -')
|
||||
console.log(array)
|
||||
// After Sort
|
||||
console.log('- After Sort | Implementation of Comb Sort -')
|
||||
console.log(combSort(array))
|
||||
console.log('\n')
|
Reference in New Issue
Block a user