DEV Community

The most important sorting algorithm you need to know

Safia Abdalla on February 05, 2020

Timsort Timsort is the most popular sorting algorithm that you've never heard of. If you've spent any time studying sorting algorithms i...
Collapse
 
itsrainingmani profile image
Manikandan Sundararajan

That was a great article. I've always been interested in learning more about the algorithms that programming languages use internally and this helped scratch that itch.

Also wanted to point out that the Github link to the TimSort code is invalid.

Collapse
 
captainsafia profile image
Safia Abdalla

Thank you!

The links should be fixed now.

Collapse
 
rhymes profile image
rhymes • Edited

Great explanation Safia! And thanks for refreshing my memory. As an old timer of Python I do remember when Tim Peters added this algorithm, for a while it seemed like only the Python community had this "super power" at their disposal 😂

ps. The link "Timsort in CPython on GitHub." is broken and the link at the bottom points indeed to the C implementation. I wonder if you meant to link this: bugs.python.org/file4451/timsort.txt

Collapse
 
captainsafia profile image
Safia Abdalla

Argh! Apologies. I was trying out Notion to write my blog posts and turns out it adds a redirect to all links in the exported Markdown. This is fixed now.

Collapse
 
rhymes profile image
rhymes

Thank you!

Collapse
 
abdurrkhalid333 profile image
Abdur Rehman Khalid

A very nicely written guide for a person who does not like the sorting algorithms where a person has to remember many things such as different scenarios and all other things related to time complexities, best and worst cases as well.

The Timsort looks a great way to tackle all kinds of questions and especially questions related to the interview as well.

I will Surely Implement this new Algorithm by myself so that I can understand the working of this algorithm more deeply and thoroughly as well.

Once more thank you for writing such an amazing article for an ordinary programmer like me.

Collapse
 
supunkavinda profile image
Supun Kavinda

Safia, thanks for sharing. Never knew that.

Fun fact: I read the whole article as Timesort until I saw the name Tim at the end :D

Collapse
 
captainsafia profile image
Safia Abdalla

I had to stop myself from typing "Timesort" so many times while writing this.

Collapse
 
enscripter profile image
Isaiah Griego

I read the whole thing as Timesort until I read these comments ðŸĪŠ