BATTLE OF THE SORTS: which sorting algorithm is the fastest? (visualization)
ฝัง
- เผยแพร่เมื่อ 7 พ.ค. 2020
- In this visualization, we run 10 different sorting algorithms in 5 minutes to determine which one is the fastest.
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. We made this TH-cam channel and Kite to help you be more productive: kite.com/download/?...
***************************************
JOIN Kite's Developer Community on Facebook ►
/ 505658083720291
SUBSCRIBE for more Python tips, tutorials, and project breakdowns! ► th-cam.com/users/KiteHQ?sub_...
FOLLOW US onTwitter ► / kitehq
***************************************
OTHER COOL VISUALIZATIONS:
3 Levels of Sorting Algorithms - FASTEST Comparison Sort! ►
• 3 Levels of Sorting Al...
Simulating COVID-19 using Python, NumPy & Matplotlib [in-depth tutorial] ►
• Simulating COVID-19 us...
BIGGEST Codebases in History - Can you guess the largest? ►
• BIGGEST Codebases in H...
***************************************
Don’t forget to subscribe :)
th-cam.com/users/KiteHQ?sub_...
STAY TUNED:
Kite ► kite.com/
Twitter ► / kitehq
TH-cam ► / @kitehq - วิทยาศาสตร์และเทคโนโลยี
This is the sort of video that the TH-cam algorithm will suddenly find in 4 years
I see what you did there ;)
@@note_guessr2565 I don't... What did I do??
@@sanjacobs6261 it looked like a pun hahahaha (sorting algorithms, and the sort of video the algorithm o TH-cam would recommend)
@@note_guessr2565 OH SHIT HAHAH I DIDN'T SEE WHAT I DID THERE
@@sanjacobs6261 😂😂 it was reeally good
selection sort: 1830 comparisons
bubble sort: 1809 comparisons
insertion sort: 968 comparisons
heap sort: 952 comparisons
merge sort: 287 comparisons
timsort: 566 comparisons
introsort: 280 comparisons
quicksort: 286 comparisons
bogosort: 1 comparisons
@@icaro8264 if u r lucky 😆😆😆
radix sort: 0 comparisons
While time seems to correlate with the number of comparisons, why does that fall apart for the faster algorithms? Why are timsort's comparisons so much faster than merge? Same with quicksort and introsort?
@@Fexisepic Comparisons are just one component of sorting, there's also the action of when and where to move once you've got the result of your comparison.
You can't tell me 3:26 doesn't sound like boss music
Answer- Results depends on the Data
I like how you simplified and slowed it down enough for our casual eyes to see. I hope that the yt algorithm (heh) sorts you to the top!
TH-cam's recommendation algorithm has a constant time complexity scale of two years
lol true
@@softed true
what does that mean? @@softed
Nailed it beautiful representation 😍
Mergesort is so amazing to watch
Props to whoever did the sound effects
Nice, although the end card came up too quickly that I couldn't appreciate the glory of quicksort
Why didn't you include bogosort lol
(I'm kidding)
Lol my favorite is bogo sort
Best sort also if you get lucky you can get it first shot!
Because Bogosort is always grumpy!
Bogo sort added: video length is 48:22:43
1:41
It’s not an Insertion Sort at all, it’s actually an Optimized Gnome Sort because it shows swaps in it, while Insertion Sort doesn’t have swaps
why didn't you put quantum sort?
it finds the correctly sorted list in all possible permutations.
like Bogosort, but instant.
i believe he doesnt have a quantum computer to do it instantly lol
@@LordOfSky_41G fair reason.
Plus that doesn’t make for an interesting visual
Bogo sort is the most inefficient one, its used only for theoretical purpose.
@@amaresh-qq6qlit could solve it instantly 😏
This is actually really good
Hm, heapsort is doing awful for O(n*logn), tbh. Great representation, btw. Thanks alot!
such a great video
1:22 sounds like an incomplete F# major scale
Perfect pitch?
I also have
3:06 Merge sort sounds like in Mario Bros. Classic, when you jump and hit a koopa or something. The comparison part of it reminds me of dig dug.
when part of it were already in order, this would be the time for timsort to shine ;)
You're telling me that bubble sort isn't the worst? what?
You’re on 7th place!
1:52 epic music
i really like the weird sounds ahah
me: *hm I do wonder which is fastest*
me after the video: I'm dumb, quicksort literally has "quick" in its name lol
I did not see bucket sort in this comparsion. That has been the fastest for me (or is it called radix sort.. :)
You’re on 8th, 3rd, 5th place!
Surely insertion sort could benefit from binary search?
There is no one best sorting algorithm. Which one to use depends upon what where the data comes from and what state it's in at the outset (mostly already sorted for example). Radix sorting is good but some kind of incremental sort as data is recieved can still beat it if that's possible. Maybe you need to be able to access mostly sorted data before completion, which you won't get from radix sort.
Also in Spyder, isn't? I have it installed in Spyder.
nice video visualization, got a bit turned on actually
I assume different sorting algorithms are better for different applications, or does everyone just use quick sort?
Depending on the application different sorting methods may be better. For example merge sort is very quick but does require extra memory for its subarrys which a slower algorithm like insertion sort doesn't.
But there are clear better options for larger sorting.
No one would use bubble sort though.
Yeah comes down to data size/memory constraints/efficiency and that last one is determined by how the method interacts with the first two.
@@whisperware in reality everybody just uses whatever the standard library sort is as it's good enough in 99% of cases.
0:35 Does anything actually use selection sort? If so, why?
Very easy to implement (just 2 for-loops), fast enough for small amounts of data. I prefer it to bubblesort when I teach arrays.
Song name at the start?
Start from 0:30 and set playback speed 0.25, you will hear nice melody
Merge sort may contain traces of ringtones
radix sort plsss
1:02 115! *INSERT GUITAR*
pigeon hole sort?
Quicksort…
Thats why its so quick
*Quick* sort
The fastest sorting algorithm I know is "Radixsort (LSD)".
Quick sort is the answer!
No
Depends of the context
Like with every algorithme
Radix sort works very well if you’re trying to sort a deck of punched cards you had your FORTRAN program on. And dropped. O(n). Depends on what you’re trying to sort.
In common, yes
✅
Babe I lied, there is no Netflix, today we are gonna watch sorting algorithms
1:11 - 1:12 sounds like B major
Where is bogosort the best alg?
Yo quicksort cheated, it had "quick" in its name
is this dubstep?
blud really wants us to use kite
Can you test the cpp's std::sort()
I’m pretty sure it just uses quicksort
@@deanlongmire6166 nope, it's introsort.
Earthbound music be like
Why put junk all over the screen on the best one?
I am probably the only one who searched for this...
Radix sort LSD should be number 1.
Why did you forget it ?
because it can't sort arbitrary objects, just integers. And if you want to include all sorts in general, then Bitonic or odd-even merge sorts will be the best with time complexity of O(log(n)).
Where is pigeonhole ?
Showing the annoying ad hundred times is unlikely to make people instantly download the thing...
ofc quicksort gets it
Where my binary sort
See you in 2026
00:03:19 ааррааььббссккааяя ннооччььъъььъуъьуь
I prefer bozosort
I don't know why we are even made to learn bubble sort....it's the worst sorting algorithm.
I think because it's the easiest one to learn(expect bogo sort) and does his job properly for small arrays
it's for beginners bro
You’re on 7th place!
bogo solo's
No bogosort? Unliked, unsubscribed, and uncommented
uncommented lmao
Stalin sort is faster :/