Data update
This commit is contained in:
parent
4bb20c9b71
commit
cbaf4c4b64
12390 changed files with 318560 additions and 27248 deletions
|
|
@ -8,17 +8,17 @@ sub gnome_sort
|
|||
my $i = 1;
|
||||
my $j = 2;
|
||||
while($i < $size) {
|
||||
if ( $a[$i-1] <= $a[$i] ) {
|
||||
$i = $j;
|
||||
$j++;
|
||||
} else {
|
||||
@a[$i, $i-1] = @a[$i-1, $i];
|
||||
$i--;
|
||||
if ($i == 0) {
|
||||
$i = $j;
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
if ( $a[$i-1] <= $a[$i] ) {
|
||||
$i = $j;
|
||||
$j++;
|
||||
} else {
|
||||
@a[$i, $i-1] = @a[$i-1, $i];
|
||||
$i--;
|
||||
if ($i == 0) {
|
||||
$i = $j;
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return @a;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue