Updated the count sort algorithm with stable implementation. Added ES6 syntactic sugar to the syntax

This commit is contained in:
Mandy8055
2021-08-08 17:14:41 +05:30
parent c55ca93584
commit 6232f8dd42

View File

@ -28,9 +28,7 @@ const countingSort = (arr, min, max) => {
res[count[arr[i] - min]] = arr[i]
count[arr[i] - min]--
}
// Copy the result back to back to original array
arr = [...res]
return arr
return res
}
/**