Sort disjoint sublist: Difference between revisions
m
→{{header|Wren}}: Minor tidy
(Added Easylang) |
m (→{{header|Wren}}: Minor tidy) |
||
(One intermediate revision by one other user not shown) | |||
Line 1,774:
=={{header|Elena}}==
ELENA
<syntaxhighlight lang="elena">import extensions;
import system'routines;
Line 1,783:
sortSublist(indices)
{
var subList := indices.orderBy::(x => x)
.zipBy(indices.selectBy::(i => self[i])
.orderBy::(x => x), (index,val => new{ Index = index; Value = val; }))
.toArray();
var list := self.clone();
subList.forEach::(r)
{
list[r.Index] := r.Value
Line 3,754:
=={{header|Wren}}==
{{libheader|Wren-sort}}
<syntaxhighlight lang="
// sorts values in place, leaves indices unsorted
|