There are a dozen sorting algorithms, so which one is actually used when you call sort()?
Every sorting algorithm has its shortcomings.
Because of that, we don’t rely only on one of them but combine two or more together.
A combination of two or more algorithms that solve the same problem is called hybrid algorithm.
Languages such as Java or Python are using Timsort, which is derived from Merge sort and Insertion sort and is designed to perform well on many kinds of real-world data.
C++ standard libraries, Microsoft .Net platform or Swift are using Introsort. Let’s take a closer look at it.
Please Like and Subscribe for more weekly videos!
Follow me on Twitter: / thecompscirocks
Follow me on Instagram: / thecompscirocks
Follow me on Facebook: / thecompscirocks
Some sources & further reading:
https://en.wikipedia.org/wiki/Hybrid_...
https://en.wikipedia.org/wiki/Timsort
https://en.wikipedia.org/wiki/Introsort
https://en.wikipedia.org/wiki/Quicksort
https://en.wikipedia.org/wiki/Heapsort
https://en.wikipedia.org/wiki/Inserti...
https://en.wikipedia.org/wiki/Merge_sort
http://www.cs.rpi.edu/~musser/gp/intr...
https://github.com/apple/swift/blob/m...
http://bigocheatsheet.com/
Смотрите видео What Happens When You Call sort()? | Introsort Algorithm Explained онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь CSRocks 14 Сентябрь 2017, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7,717 раз и оно понравилось 144 людям.