2016 Update
This commit is contained in:
parent
948b86eafa
commit
dcf5d15da3
7965 changed files with 139854 additions and 31002 deletions
|
|
@ -1,2 +1,8 @@
|
|||
{{Sorting Algorithm}}
|
||||
In this task, the goal is to sort an integer array with the [[wp:Radix sort|radix sort algorithm]]. The primary purpose is to complete the characterization of sort algorithms task.
|
||||
|
||||
|
||||
;Task:
|
||||
Sort an integer array with the [[wp:Radix sort|radix sort algorithm]].
|
||||
|
||||
The primary purpose is to complete the characterization of sort algorithms task.
|
||||
<br><br>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ sub radsort (@ints) {
|
|||
for reverse ^$maxlen -> $r {
|
||||
my @buckets = @list.classify( *.substr($r,1) ).sort: *.key;
|
||||
if !$r and @buckets[0].key eq '-' { @buckets[0].value .= reverse }
|
||||
@list = map *.value.values, @buckets;
|
||||
@list = flat map *.value.values, @buckets;
|
||||
}
|
||||
@list».Int;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue