Skip to content

Commit 1626a58

Browse files
committed
Improved presentation of Implementation | Cycle Sort
1 parent d866534 commit 1626a58

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

Sorts/CycleSort.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,15 @@ function cycleSort (list) {
5353
}
5454
return writes
5555
}
56-
const arrOrignal = [5, 6, 7, 8, 1, 2, 12, 14]
57-
// Array before Sort
58-
console.log(arrOrignal)
59-
cycleSort(arrOrignal)
60-
// Array after sort
61-
console.log(arrOrignal)
56+
57+
/**
58+
* Implementation of Cycle Sort
59+
*/
60+
const array = [5, 6, 7, 8, 1, 2, 12, 14]
61+
// Before Sort
62+
console.log('\n- Before Sort | Implementation of Cycle Sort -')
63+
console.log(array)
64+
// After Sort
65+
console.log('- After Sort | Implementation of Cycle Sort -')
66+
console.log(countingSort(array))
67+
console.log('\n')

0 commit comments

Comments
 (0)