Partition the array into a sorted part and an unsorted part and use swaps to move elements around.