As you can see, on the last part of the iteration, which is more likely like insertion sort, so I won't ask how to do it in insertion sort. The big problem is the first part, second part, third part of the iteration, because it makes no sense. And in the last part of the iteration. I does highlight too the values that don't swap.