When we had to write a sort...
...which was rare because of decent utilities available for use, we used to use something we called bubble sort. It had you going through the list and swapping positions if the two elements under consideration were in the wrong order. Flip through the list repeatedly till no more swaps were necessary. The reason we used it was because it was so darned easy to code.
