r/Python • • Jun 11 '21

Tutorial step by step swap visualization of sorting algorithm. This video has 2 parts firs,t swapping visualization and second, explanation of each sorting algorithm with different criteria including python code.

https://youtu.be/lfAymcJm3DY
78 Upvotes

3 comments sorted by

3

u/gw-green Jun 11 '21

Timsort and insertion sort do exactly the same thing in the visualisation. What’s the difference between them?

2

u/restinworld Jun 11 '21

Timsort uses combination of insertion sort and merge sort. And, for smaller list, timsort turns into a single insertion list. That's why visualization of insertion sort and timsort is same.

We will require a longer list, to see the visualization difference between both the sort.

2

u/ManyInterests Python Discord Staff Jun 11 '21

this visualization may help. Tim sort works in "runs" that help it work better with real-world data.