Skip to content

Commit cf0be7e

Browse files
committed
Improved Implementation Presentation | CombSort
1 parent 1c49766 commit cf0be7e

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Sorts/CombSort.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,15 @@ function combSort (list) {
4242
}
4343
return list
4444
}
45-
const arrOrignal = [5, 6, 7, 8, 1, 2, 12, 14]
46-
// Array before Sort
47-
console.log(arrOrignal)
48-
const arrSorted = combSort(arrOrignal)
49-
// Array after sort
50-
console.log(arrSorted)
45+
46+
/**
47+
* Implementation of Comb Sort
48+
*/
49+
const array = [5, 6, 7, 8, 1, 2, 12, 14]
50+
// Before Sort
51+
console.log('\n- Before Sort | Implementation of Comb Sort -')
52+
console.log(array)
53+
// After Sort
54+
console.log('- After Sort | Implementation of Comb Sort -')
55+
console.log(combSort(array))
56+
console.log('\n')

0 commit comments

Comments
 (0)