Question: Sorting of a list

Question:Sorting of a list

CKOne 40 Maple

I have used bubble sort to put my list in order but now i need help to rearrange the list.

For example l:=[2,2,2,3,4,5,1,3,7,8,9]
Bubble sort:= [1,2,2,2,3,3,4,5,7,8,9]

What i want to do is do, smallest&largest,next smallest & next largest
Like this - [1,9,2,8,2,7,2,5,3,4,3]
So as you can see its been rearranged so that their all next to each other.

Any help would be great.

Please Wait...