Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9299a5

Browse files
committed
array.length -> size
1 parentde706f1 commitf9299a5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/sorting/radixsort.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
}
6969

7070
/* Count frequency of each array element */
71-
for(j=0;j<array.length;j+=1){
71+
for(j=0;j<size;j+=1){
7272
digit=getDigit(array[j],i)||0;
7373
count[digit]+=1;
7474
}
@@ -80,14 +80,14 @@
8080

8181
/* Move elements to auxilary array */
8282
varaux=[];
83-
for(j=array.length-1;j>=0;j-=1){
83+
for(j=size-1;j>=0;j-=1){
8484
digit=getDigit(array[j],i)||0;
8585
count[digit]-=1;
8686
aux[count[digit]]=array[j];
8787
}
8888

8989
/* Copy elements back from auxilary array */
90-
for(j=0;j<array.length;j+=1){
90+
for(j=0;j<size;j+=1){
9191
array[j]=aux[j];
9292
}
9393
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp