Improved Implementation presentation | Counting Sort

This commit is contained in:
marsonya
2021-01-24 23:34:22 +05:30
parent e6e6648eaf
commit e0260015cb

View File

@ -30,11 +30,14 @@ function countingSort (arr, min, max) {
return arr return arr
} }
const arr = [3, 0, 2, 5, 4, 1] /**
* Implementation of Counting Sort
// Array before Sort */
console.log('-----before sorting-----') const array = [3, 0, 2, 5, 4, 1]
console.log(arr) // Before Sort
// Array after sort console.log('\n- Before Sort | Implementation of Counting Sort -')
console.log('-----after sorting-----') console.log(array)
console.log(countingSort(arr, 0, 5)) // After Sort
console.log('- After Sort | Implementation of Counting Sort -')
console.log(comcountingSortbSort(array))
console.log('\n')