Hi, I'm stuck on how to create a procedure, 'Arrange' that sorts a list of integers so that the numbers go from smallest to largest. So if I have a list such as: [3,6,1,9,0,4] ,
Arrange([3,6,1,9,0,4]) = [0,1,3,4,6,9]
I have a procedure that produces a sequence where we denote 'x' as the first number in the list, and returns: a list of all the numbers in the list less than x, x, a list of all the numbers greater than x.
i.e. returns: [1, 0], 3, [6, 9, 4]
Arrange := proc(L)
if n=0 then
elif n=1 then
elif n>1 then
for i from 2 to n do
if L[i] < x then
could anyone help on how I can expand on this to get the procedure that I want?
p.s. I know that there is already an inbuilt 'sort' function in Maple, but I'm trying to create the procedure myself!