Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
C:\Consulting\rakudo>type test.p6
multi quicksort([$pivot, *@rest]) {
quicksort(@rest.grep(* < $pivot)),
$pivot,
quicksort(@rest.grep(* >= $pivot))
}
multi quicksort([]) { () }
my @x = 5, 8, 1, 9, -2, 3, 6;
say quicksort(@x).perl
C:\Consulting\rakudo>perl6 test.p6
[-2, 1, 3, 5, 6, 8, 9]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment