Skip to content

Instantly share code, notes, and snippets.

@jnthn
Created October 29, 2009 18:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jnthn/221659 to your computer and use it in GitHub Desktop.
Save jnthn/221659 to your computer and use it in GitHub Desktop.
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