err...I have to say, (I can't remember the exact time I met this version of quicksort), ever since the Haskell version was born, there were (and still are) various implementations available in various languages. This version of quicksort is a very nature "translation" of what the algorithm is:
function quicksort(list) {
select a pivot;
return (quicksort([x|x<pivot]), pivot, quicksort([x|x>pivot]));
}
After finished my baby "run mode", I opened my browser to give it a shot. It worked, and I start wondering why it worked. The last statements of those examples are
return $output;
Mine's not, it looked like this(I forgot to add "return" by accident):
sub run_mode_1 {
my $self = shift;
my $query = $self->query();
my $output = q[];
... …