Hi,
I want to shift the first two elementsof a list to the end and this is what i've coded i have to run the proc twice. Is there a simpler way of doing this??? for example
L:=[1,2,3,4,5] => [3,4,5,1,2]
switch2:=proc(N)
local y,li:
li:=N:
for y from 1 to nops(li)-1 do
(li[y],li[y+1]):=(li[y+1],li[y])
od:
li;
end proc:
Is there another simpler way of doing this aswell??
L:=[1,2,3,4,5] => [2,1,4,5,3]
switch:=proc(odd)