Here's a very simple one (it's rubbish, but simple).
1 2 3 4 5
Look at first two names in list.
If in wrong alphabetical order, swap them around. Start again.
If not in wrong alphabetical order, move on to names 2 and 3.
If in wrong alphabetical order, swap them around. Start again.
If not in wrong alphabetical order, move on to names 3 and 4.
And so on. You can easily do better than this algorithm given a few minutes thought.
The bigger picture here is that you've started to get into actual programming. All that stuff about learning the language isn't programming. It's just learning the language. Programming is the art, craft and science of thinking about problems in such a way that the solution lends itself to a programmatic solution. If you need to rearrange the list into alphabetical order, you're going to have to think. Honestly, there's no trick to it. Just think about it.