Sorting algorithms/Quicksort: Difference between revisions
Content added Content deleted
imported>Rcmlz |
imported>Rcmlz |
||
Line 8,271: | Line 8,271: | ||
<syntaxhighlight lang="raku" line> |
<syntaxhighlight lang="raku" line> |
||
#| Recursive, single-thread, random pivot, single-pass, quicksort implementation |
#| Recursive, single-thread, random pivot, single-pass, quicksort implementation |
||
multi quicksort(\a where a.elems < 2) { a } |
|||
⚫ | |||
return a if a.elems < 2; |
|||
⚫ | |||
my %prt{Order} is default([]) = a.classify: * cmp pivot; |
my %prt{Order} is default([]) = a.classify: * cmp pivot; |
||
|samewith(%prt{Less}), |%prt{Same}, |samewith(%prt{More}) |
|samewith(%prt{Less}), |%prt{Same}, |samewith(%prt{More}) |