Search/Sorts algoruthms : remove live code & console.log, leave examples as comments.

This commit is contained in:
Eric Lavault
2021-10-11 12:29:03 +02:00
parent 8a7be96c9d
commit 74f296578a
22 changed files with 121 additions and 197 deletions

View File

@ -4,7 +4,7 @@
* significant position.
* For more information see: https://en.wikipedia.org/wiki/Radix_sort
*/
function radixSort (items, RADIX) {
export function radixSort (items, RADIX) {
// default radix is then because we usually count to base 10
if (RADIX === undefined || RADIX < 1) {
RADIX = 10
@ -41,12 +41,3 @@ function radixSort (items, RADIX) {
}
return items
}
// Implementation of radixSort
const ar = [5, 6, 7, 8, 1, 2, 12, 14]
// Array before Sort
console.log(ar)
radixSort(ar)
// Array after sort
console.log(ar)