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

Commitde706f1

Browse files
committed
Update recursive insertion sort
1 parent180ac8e commitde706f1

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

‎src/sorting/recursive-insertionsort.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@
2727
*/
2828
functionrecursiveInsertionSort(array,cmp,max){
2929
cmp=cmp||compare;
30-
if(max<=0){
31-
returnarray;
32-
}
3330
if(max===undefined){
3431
max=array.length-1;
3532
}
33+
if(max<=0){
34+
returnarray;
35+
}
3636
recursiveInsertionSort(array,cmp,max-1);
3737
for(vari=max-1,current=array[max];
3838
i>=0&&cmp(current,array[i])<0;i-=1){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp