YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
10
Task/Sort-disjoint-sublist/Maple/sort-disjoint-sublist.maple
Normal file
10
Task/Sort-disjoint-sublist/Maple/sort-disjoint-sublist.maple
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
sortDisjoint := proc(values, indices::set)
|
||||
local vals,inds,i:
|
||||
vals := sort([seq(values[i], i in indices)]):
|
||||
inds := sort(convert(indices, Array)):
|
||||
for i to numelems(vals) do
|
||||
values(inds[i]) := vals[i]:
|
||||
od:
|
||||
end proc:
|
||||
tst := Array([7,6,5,4,3,2,1,0]):
|
||||
sortDisjoint(tst,{7,2,8});
|
||||
Loading…
Add table
Add a link
Reference in a new issue