3 Levels of Sorting Algorithms - FASTEST Comparison Sort!

preview_player
Показать описание
This video explores the concept of sorting, and comparison sorts in particular. Sorting algorithms are key to the performance of many operations such as search and database operations.

***************************************

***************************************
ADDITIONAL RESOURCES:

6 Python Tips and Tricks YOU Should Know ►

How to NAIL LeetCode Questions– Valid Parentheses ►

Sqlite 3 Python Tutorial in 5 minutes - Creating Database, Tables and Querying►

***************************************
Don’t forget to subscribe :)

STAY TUNED:
Рекомендации по теме
Комментарии
Автор

Just started a computer science degree at 44, long way to go. Great video but, thanks.

iwktwom
Автор

Based on the sheer volume of documentation on sorting algorithms, I honestly thought it would be a significant factor in my programming career.

I doubt in the last 20 years I’ve ever sorted a single thing….

But still fascinating.

diamondsmasher
Автор

i didn't understand a single thing but still gave a like

viacheslav
Автор

I've watched hours of algo videos during the past few weeks and this video is thorough yet significantly easier to understand than most others. Thank you!

DanielSposito
Автор

The main advantage of TimSort is that it works really well on partially sorted data. It's pretty rare to come across truly random data and when the data is already partially organised TimSort has the intelligence to skip over the already sorted sections while other algorithms will naively sort them.

Also there should be an honourable mention to non-comparative sorts like Bin and Radix sorts. Radix, especially, can be incredibly fast when the sort keys are can be expressed as Integers with a known range. It's O(n) complexity, and while it does a lot of swaps, it has good memory locality which helps with cache misses.

daniel.lupton
Автор

lvl 1 -O(n^2) - bubble, selection, insertion,
lvl 2- O(nlogn) - merge, quick, heap

dcrey
Автор

For those who can't see the text at the end graphs, Introsort took 1st followed closely by Timsort and Quicksort in 2nd/3rd place respectively

SimGunther
Автор

Thank you for the explanation about insertion sort. There seems to be some conflicting information out there about if it is actually quicker or not in comparison to bubble or selection sort methods - I think the important distinction to make is that it is in fact faster than those methods in best-case scenario, and the same in the worst-case scenario - but in between best and worst-case, it is still potentially quicker than the other two.

AlyssaMarie-vrcc
Автор

I think it would have made sense to mention that these comparisons here are AFAIU based on the idea of equal access times to all elements. This is seldom through nowdays with several levels of caches and virtual memory. In the old days this was even more of an issue when the data was on multiple tapes where the seek times were enormous compared to anything else. I guess merge search is then then an important step in sorting as you can sort a section in main memory, write it out on tape and then read from several tape units one item, pick the largest one and write it all out as you go to yet an other tape unit. I'm not old enough to 'have been there done that', but old enough to see the step, stop operation of a large number or tape units in movies and I always suspected that was because of merge sortin. At least in many cases.

Axel_Andersen
Автор

After watching this video, I remembered my lecturer who taught us those sorting algorithm in the same way as presented here, that is just reading from the slides. In the class, I pretended to understand everything and listen carefully, but in the end, I didn't understand anything.

aakashbashyal
Автор

Very underrated channel.
Excellent content. Keep it up❤️❤️❤️

dhananjaypanage
Автор

I found Sedgewick's "Algorithms" to be great at going into lots more detail about sorts (and other things). That's where I also learnt that MergeSort and HeapSort came about because of using and building tree-oriented data structures.

static-san
Автор

After watching this, I was finally able to sort my life out

CompilerStuck
Автор

It seems like someone could do analysis on which algorithm works best on what type of data (size, data type, % already sorted...), and just select the proper algorithm(s) to sort. For example, if it is known that algorithm A works best on almost sorted data and that condition is detected, then run algorithm A on it.

davidjames
Автор

Wow that was quick. I would have liked to have seen the finish of the race.

revanslacey
Автор

Distribution sorts can get to the minimum time complexity of O(n).

*Examples:*
Bucket sort
Counting sort
Flash sort
Pigeonhole sort
Radix sort

Inspirator_AG
Автор

Can you make a video on how you did the animations? I assume you programmed the timing specifically (one time unit for iteration)?

jan
Автор

nice overview and graphical representation! Thanks. Last time I thought about sorting algorithms was decades ago, I assumed current libraries would do something smart. Nice to hear what ;-)

robbertwethmar
Автор

You are way smarter than I am. You could have been speaking Latin. I didn’t understand a thing but you get the gold star from me. Dropping a like

kingsfan
Автор

Does your example of bubble sort sort in ascending order while selection is descending or am I missing something?

Classicv