- or download this
sub naive (@) {
for (reverse 1..$#_) {
...
@_[$_,$r]=@_[$r,$_];
}
}
- or download this
sub bzr (@) {
my @a = 0..$#_;
...
my $n;
map +($_[$a[$n=rand($i--)]], $a[$n]=$a[$i])[0], @_;
}
- or download this
my $x = $l[$r];
$l[$r] = $l[$_];
$l[$_] = $x;
- or download this
sub naive2 (@) {
my @l=@_;
...
}
@l2;
}