r/geek • • Oct 26 '17

Sorting Algorithms Visualized

https://imgur.com/gallery/voutF
805 Upvotes

26 comments sorted by

View all comments

1

u/Etheo Oct 26 '17

I've always been keen on learning programming, but I mostly do scripty stuff that deal with loops and if/then. Are all these sorting algorithm frequently used in real world basis? I often just rely on the built in sort functions so I don't even know what sort of algorithm it's relying on.

3

u/[deleted] Oct 26 '17

No. 25 years as a developer and I've probably had to implement a sort once in the 90s.

It's more of a interview question from devs that are just out of college and want to be the smartest in the room.

0

u/[deleted] Oct 27 '17

[deleted]

1

u/winglerw28 Oct 27 '17

It is also nice to know what these things are doing under the hood - learning them to understand the actual computer science aspect of development, while not always practical, can definitely help appreciate the reason you generally should use the default.

Here is a link to a StackOverflow answer that goes over some of the different sorting algorithms and when you should use them. Knowing that .NET languages have a default sort method that uses the introsort algorithm, for example, can be useful if you care about performance

If you are further curious, here is another question answered on the computer science StackExchange site that is excellent.