X Tutup
Skip to content

Commit aab8a55

Browse files
committed
Cocktail Shaker Sort | Improved Implementation
1 parent ac488fe commit aab8a55

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Sorts/CocktailShakerSort.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,11 @@ function cocktailShakerSort (items) {
3535
/**
3636
* Implementation of Cocktail Shaker Sort
3737
*/
38-
var ar = [5, 6, 7, 8, 1, 2, 12, 14]
38+
var array = [5, 6, 7, 8, 1, 2, 12, 14]
3939
// Before Sort
40-
console.log(ar)
41-
cocktailShakerSort(ar)
40+
console.log('\n- Before Sort | Implementation of Cocktail Shaker Sort -')
41+
console.log(array)
4242
// After Sort
43-
console.log(ar)
43+
console.log('- After Sort | Implementation of Cocktail Shaker Sort -')
44+
console.log(cocktailShakerSort(array))
45+
console.log('\n')

0 commit comments

Comments
 (0)
X Tutup