Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
imported>Rcmlz |
imported>Rcmlz |
||
Line 8,282: | Line 8,282: | ||
<syntaxhighlight lang="raku" line> |
<syntaxhighlight lang="raku" line> |
||
#| Recursive, parallel, single-pass, quicksort implementation |
#| Recursive, parallel, random pivot, single-pass, quicksort implementation |
||
multi quicksort-parallel-naive(\a where a.elems < 2) { a } |
|||
multi quicksort-parallel-naive(\a, \pivot = a.pick) { |
|||
return @a if @a.elems < 2; |
|||
⚫ | |||
my $pivot = @a.pick; |
|||
⚫ | |||
my Promise $less = start { samewith(%prt{Less}) } |
my Promise $less = start { samewith(%prt{Less}) } |
||
my $more = samewith(%prt{More}); |
my $more = samewith(%prt{More}); |