Apparently I've been doing bubble sort... I didn't know there was a swap function though. Most programming languages require the use of a temporary placeholder, so here is what it usually looks like.