There have been many times, we get doubts about how a certain algorithms work. There is no better way than being able to visualise that algorithm. For example check this page where you can see how each sort works on same array input.
These are created by David Galles, an Associate Professor of department of Computer Science University of San Francisco.
You will be able to see lot more visualizations by going to this page.