(Gif's are fasforwaded to take less time)
Time taken by each algorithm was:
■ Merge Sort - 1 min 35 sec.
■ Quick Sort - 1 min 9 sec.
■ Insertion Sort - 1 min 53 sec.
■ Bubble Sort - 3 min 28 sec.
■ Selection Sort - 4 min 19 sec.
Full video: Visualize sorting algorithms
Here I've used #matplotlib to draw bar graph of the array, where height of bar represents the number on that position.
Using 5 of the most known sorting algorithms to visualize how each element move in the array.
The program generates a list of 10 random elements between 1 and 100. Number of elements can be changed by the user and user can even input his own list.