Another update from ingydotnet^djgoku

This commit is contained in:
Ingy döt Net 2015-11-18 06:14:39 +00:00
parent 91df62d461
commit 948b86eafa
7604 changed files with 108452 additions and 22726 deletions

View file

@ -1,8 +1,7 @@
sub quick_sort {
my @a = @_;
return @a if @a < 2;
my $p = splice @a, int rand @a, 1;
quick_sort(grep $_ < $p, @a), $p, quick_sort(grep $_ >= $p, @a);
return @_ if @_ < 2;
my $p = splice @_, int rand @_, 1;
quick_sort(grep $_ < $p, @_), $p, quick_sort(grep $_ >= $p, @_);
}
my @a = (4, 65, 2, -31, 0, 99, 83, 782, 1);