Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Sorting an array

Name: Anonymous 2010-10-24 4:13

There's an array of values from 1 to n. It isn't sorted. We have to sort it, but there are only to ways to move: third element to beginning or last element to beginning. How to do that ?

Name: Anonymous 2010-10-24 14:41

>>16
Reading over my own post, I mislabeled a step, accidentally a swap, and messed myself up.  Redo; alternate:
2 1 3 4:
4 2 1 3 (last-->1)
3 4 2 1 (last-->1)
2 3 4 1 (3-->1)
1 2 3 4 (last-->1) (done)

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List