Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de706f1 commit f9299a5Copy full SHA for f9299a5
src/sorting/radixsort.js
@@ -68,7 +68,7 @@
68
}
69
70
/* Count frequency of each array element */
71
- for (j = 0; j < array.length; j += 1) {
+ for (j = 0; j < size; j += 1) {
72
digit = getDigit(array[j], i) || 0;
73
count[digit] += 1;
74
@@ -80,14 +80,14 @@
80
81
/* Move elements to auxilary array */
82
var aux = [];
83
- for (j = array.length - 1; j >= 0; j -= 1) {
+ for (j = size - 1; j >= 0; j -= 1) {
84
85
count[digit] -= 1;
86
aux[count[digit]] = array[j];
87
88
89
/* Copy elements back from auxilary array */
90
91
array[j] = aux[j];
92
93
0 commit comments