This has been discussed before so you might read this discussion
Most sort algorithms have two key activities
Compare two elements in the collection to sort
Swap two elements in the collection if in the wrong order.
One possible solution is to remember the elements being compared / swapped in another data structure e.g. a list and then iterate forwards or backwards displaying the current state of the collection.
This is the solution I have used in the sketch shown in the linked discussion.