Improved Implementation Presentation | CombSort

This commit is contained in:
marsonya
2021-01-23 22:27:19 +05:30
parent 1c497661fd
commit cf0be7e3e4

View File

@ -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')