Created
October 29, 2009 18:15
-
-
Save jnthn/221659 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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