BATTLE OF THE SORTS: which sorting algorithm is the fastest? (visualization)

  Рет қаралды 104,229

Kite

Kite

4 жыл бұрын

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 KZfaq channel and Kite to help you be more productive: kite.com/downl...
***************************************
JOIN Kite's Developer Community on Facebook ►
/ 505658083720291
SUBSCRIBE for more Python tips, tutorials, and project breakdowns! ► www.youtube.co...
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 :)
www.youtube.co...
STAY TUNED:
Kite ► kite.com/
Twitter ► / kitehq
KZfaq ► / @kitehq

Пікірлер: 145
@sanjacobs6261
@sanjacobs6261 4 жыл бұрын
This is the sort of video that the KZfaq algorithm will suddenly find in 4 years
@note_guessr2565
@note_guessr2565 4 жыл бұрын
I see what you did there ;)
@sanjacobs6261
@sanjacobs6261 4 жыл бұрын
@@note_guessr2565 I don't... What did I do??
@note_guessr2565
@note_guessr2565 4 жыл бұрын
@@sanjacobs6261 it looked like a pun hahahaha (sorting algorithms, and the sort of video the algorithm o KZfaq would recommend)
@sanjacobs6261
@sanjacobs6261 4 жыл бұрын
@@note_guessr2565 OH SHIT HAHAH I DIDN'T SEE WHAT I DID THERE
@note_guessr2565
@note_guessr2565 4 жыл бұрын
@@sanjacobs6261 😂😂 it was reeally good
@kellisuzuki8889
@kellisuzuki8889 3 жыл бұрын
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
@icaro8264
@icaro8264 2 жыл бұрын
bogosort: 1 comparisons
@hanishparmar7244
@hanishparmar7244 2 жыл бұрын
@@icaro8264 if u r lucky 😆😆😆
@BlackStarEOP
@BlackStarEOP Жыл бұрын
radix sort: 0 comparisons
@Fexisepic
@Fexisepic Жыл бұрын
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?
@ed7590
@ed7590 Жыл бұрын
@@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.
@tannerprewitt4489
@tannerprewitt4489 2 жыл бұрын
You can't tell me 3:26 doesn't sound like boss music
@Autrone
@Autrone 2 жыл бұрын
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!
@softed
@softed Жыл бұрын
KZfaq's recommendation algorithm has a constant time complexity scale of two years
@Autrone
@Autrone Жыл бұрын
lol true
@jerryy147
@jerryy147 Жыл бұрын
@@softed true
@MohamedAhmed-le8mv
@MohamedAhmed-le8mv 7 ай бұрын
what does that mean? @@softed
@silly.billy_real
@silly.billy_real 2 күн бұрын
really? I watched a single video about other algorithms and it sorted the first comparison
@tim0lmazan162
@tim0lmazan162 4 жыл бұрын
Why didn't you include bogosort lol (I'm kidding)
@asddsaasdfg2846
@asddsaasdfg2846 3 жыл бұрын
Lol my favorite is bogo sort
@sealwithawkwardness3951
@sealwithawkwardness3951 3 жыл бұрын
Best sort also if you get lucky you can get it first shot!
@iankravitz5723
@iankravitz5723 2 жыл бұрын
Because Bogosort is always grumpy!
@EpicCarillong
@EpicCarillong 4 ай бұрын
Bogo sort added: video length is 48:22:43
@vasusoni7008
@vasusoni7008 4 жыл бұрын
Nailed it beautiful representation 😍
@mfaraday4044
@mfaraday4044 4 жыл бұрын
Answer- Results depends on the Data
@CompilerStuck
@CompilerStuck 2 жыл бұрын
Mergesort is so amazing to watch
@yeahuh4128
@yeahuh4128 3 жыл бұрын
why didn't you put quantum sort? it finds the correctly sorted list in all possible permutations. like Bogosort, but instant.
@LordOfSky_41G
@LordOfSky_41G 2 жыл бұрын
i believe he doesnt have a quantum computer to do it instantly lol
@yeahuh4128
@yeahuh4128 2 жыл бұрын
@@LordOfSky_41G fair reason.
@tossboy2643
@tossboy2643 2 жыл бұрын
Plus that doesn’t make for an interesting visual
@amaresh-qq6ql
@amaresh-qq6ql Жыл бұрын
Bogo sort is the most inefficient one, its used only for theoretical purpose.
@woloexe
@woloexe 10 ай бұрын
@@amaresh-qq6qlit could solve it instantly 😏
@morkessler2456
@morkessler2456 Жыл бұрын
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
@minhtoquang8332
@minhtoquang8332 2 жыл бұрын
Props to whoever did the sound effects
@JordanBeagle
@JordanBeagle 2 жыл бұрын
Nice, although the end card came up too quickly that I couldn't appreciate the glory of quicksort
@daveslamjam
@daveslamjam 3 жыл бұрын
You're telling me that bubble sort isn't the worst? what?
@tendollar35
@tendollar35 2 жыл бұрын
You’re on 7th place!
@rubikonium9484
@rubikonium9484 3 жыл бұрын
1:22 sounds like an incomplete F# major scale
@segmentsAndCurves
@segmentsAndCurves 3 жыл бұрын
Perfect pitch?
@maurolionelmipianoyyo11
@maurolionelmipianoyyo11 2 жыл бұрын
I also have
@andyanderson222
@andyanderson222 3 жыл бұрын
Hm, heapsort is doing awful for O(n*logn), tbh. Great representation, btw. Thanks alot!
@kellisuzuki8889
@kellisuzuki8889 3 жыл бұрын
me: *hm I do wonder which is fastest* me after the video: I'm dumb, quicksort literally has "quick" in its name lol
@AndrewTSq
@AndrewTSq 2 жыл бұрын
I did not see bucket sort in this comparsion. That has been the fastest for me (or is it called radix sort.. :)
@tendollar35
@tendollar35 2 жыл бұрын
You’re on 8th, 3rd, 5th place!
@Legendarial
@Legendarial 3 жыл бұрын
1:52 epic music
@AleX-hu7ci
@AleX-hu7ci 8 ай бұрын
when part of it were already in order, this would be the time for timsort to shine ;)
@AbAb-th5qe
@AbAb-th5qe 4 ай бұрын
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.
@JordanBeagle
@JordanBeagle 2 жыл бұрын
I assume different sorting algorithms are better for different applications, or does everyone just use quick sort?
@Dorfelsnorf
@Dorfelsnorf Жыл бұрын
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.
@swarooprajpurohit110
@swarooprajpurohit110 Жыл бұрын
No one would use bubble sort though.
@whisperware
@whisperware 10 ай бұрын
Yeah comes down to data size/memory constraints/efficiency and that last one is determined by how the method interacts with the first two.
@user-xh9pu2wj6b
@user-xh9pu2wj6b 9 ай бұрын
@@whisperware in reality everybody just uses whatever the standard library sort is as it's good enough in 99% of cases.
@ATIHpss64HM
@ATIHpss64HM 3 жыл бұрын
This is actually really good
@D4rK3sTsH4d0W
@D4rK3sTsH4d0W Жыл бұрын
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.
@arunsharma8740
@arunsharma8740 2 жыл бұрын
Babe I lied, there is no Netflix, today we are gonna watch sorting algorithms
@xbz24
@xbz24 2 жыл бұрын
nice video visualization, got a bit turned on actually
@armybrat2869
@armybrat2869 4 жыл бұрын
Quick sort is the answer!
@user-nb6zu3rk4f
@user-nb6zu3rk4f 4 жыл бұрын
No
@sajeucettefoistunevaspasme
@sajeucettefoistunevaspasme 3 жыл бұрын
Depends of the context Like with every algorithme
@dale116dot7
@dale116dot7 3 жыл бұрын
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.
@abhisheksharnagat4508
@abhisheksharnagat4508 3 жыл бұрын
In common, yes
@tendollar35
@tendollar35 2 жыл бұрын
@JordanBeagle
@JordanBeagle 2 жыл бұрын
0:35 Does anything actually use selection sort? If so, why?
@thomasgabler3476
@thomasgabler3476 5 ай бұрын
Very easy to implement (just 2 for-loops), fast enough for small amounts of data. I prefer it to bubblesort when I teach arrays.
@MohdAli-bw1np
@MohdAli-bw1np 2 жыл бұрын
such a great video
@hellopsp180
@hellopsp180 Жыл бұрын
i really like the weird sounds ahah
@dhanisandyanto475
@dhanisandyanto475 2 жыл бұрын
Start from 0:30 and set playback speed 0.25, you will hear nice melody
@callykitten5095
@callykitten5095 10 ай бұрын
Surely insertion sort could benefit from binary search?
@martinsgaming-kanal7727
@martinsgaming-kanal7727 5 ай бұрын
The fastest sorting algorithm I know is "Radixsort (LSD)".
@blackholegt
@blackholegt Жыл бұрын
1:02 115! *INSERT GUITAR*
@fgomez
@fgomez 4 жыл бұрын
Also in Spyder, isn't? I have it installed in Spyder.
@sleevman
@sleevman 3 жыл бұрын
Yo quicksort cheated, it had "quick" in its name
@yveee9860
@yveee9860 21 күн бұрын
My fav is merge sort
@Exotic69420
@Exotic69420 3 ай бұрын
blud really wants us to use kite
@bickblakkok
@bickblakkok Жыл бұрын
Song name at the start?
@gammaboost
@gammaboost Жыл бұрын
Merge sort may contain traces of ringtones
@zeus04
@zeus04 10 күн бұрын
10 seconds to sort 60 values is still kinda slow in my opinion!
@turanbirligi6969
@turanbirligi6969 8 ай бұрын
pigeon hole sort?
@rubikonium9484
@rubikonium9484 3 жыл бұрын
1:11 - 1:12 sounds like B major
@GeodesicBruh
@GeodesicBruh Жыл бұрын
Where is bogosort the best alg?
@maurolionelmipianoyyo11
@maurolionelmipianoyyo11 2 жыл бұрын
Quicksort… Thats why its so quick *Quick* sort
@FairButNotReally
@FairButNotReally 3 жыл бұрын
I am probably the only one who searched for this...
@didierdeschamps8557
@didierdeschamps8557 Жыл бұрын
Radix sort LSD should be number 1. Why did you forget it ?
@user-xh9pu2wj6b
@user-xh9pu2wj6b 9 ай бұрын
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)).
@Rockyzach88
@Rockyzach88 2 жыл бұрын
Why put junk all over the screen on the best one?
@Luukra
@Luukra 2 жыл бұрын
is this dubstep?
@t0xicrunner
@t0xicrunner 2 жыл бұрын
Earthbound music be like
@66palach
@66palach 2 жыл бұрын
Showing the annoying ad hundred times is unlikely to make people instantly download the thing...
@khaledk13
@khaledk13 2 жыл бұрын
radix sort plsss
@wendyvicodin8745
@wendyvicodin8745 2 жыл бұрын
Where is pigeonhole ?
@master138
@master138 2 жыл бұрын
Can you test the cpp's std::sort()
@deanlongmire6166
@deanlongmire6166 Жыл бұрын
I’m pretty sure it just uses quicksort
@user-xh9pu2wj6b
@user-xh9pu2wj6b 9 ай бұрын
@@deanlongmire6166 nope, it's introsort.
@LrielMC
@LrielMC 2 ай бұрын
ofc quicksort gets it
@blockshift758
@blockshift758 Жыл бұрын
Where my binary sort
@jd-dev
@jd-dev Жыл бұрын
I prefer bozosort
@ddniel
@ddniel 4 жыл бұрын
See you in 2026
@LittleFarmLife1637
@LittleFarmLife1637 Жыл бұрын
00:03:19 ааррааььббссккааяя ннооччььъъььъуъьуь
@derpthegreatest
@derpthegreatest Жыл бұрын
bogo solo's
@brayansaldanha8358
@brayansaldanha8358 3 жыл бұрын
I don't know why we are even made to learn bubble sort....it's the worst sorting algorithm.
@Luxor-ok9hj
@Luxor-ok9hj 2 жыл бұрын
I think because it's the easiest one to learn(expect bogo sort) and does his job properly for small arrays
@user-py8bq2pk1h
@user-py8bq2pk1h 2 жыл бұрын
it's for beginners bro
@tendollar35
@tendollar35 2 жыл бұрын
You’re on 7th place!
@anthonyhu6705
@anthonyhu6705 2 жыл бұрын
No bogosort? Unliked, unsubscribed, and uncommented
@antrix2107
@antrix2107 Жыл бұрын
uncommented lmao
@vpexmc
@vpexmc 4 ай бұрын
Stalin sort is faster :/
@Somebody71828
@Somebody71828 Ай бұрын
So is bogo sort
10 FORBIDDEN Sorting Algorithms
9:41
Ardens
Рет қаралды 840 М.
I Made Sorting Algorithms Race Each Other
8:24
Green Code
Рет қаралды 104 М.
Вы чего бл….🤣🤣🙏🏽🙏🏽🙏🏽
00:18
👨‍🔧📐
00:43
Kan Andrey
Рет қаралды 10 МЛН
小蚂蚁被感动了!火影忍者 #佐助 #家庭
00:54
火影忍者一家
Рет қаралды 54 МЛН
Sorting Algorithms Explained Visually
9:01
Beyond Fireship
Рет қаралды 528 М.
Oh, wait, actually the best Wordle opener is not “crane”…
10:53
Visualizing 70 Sorting Algorithms
29:24
Kuvina Saydaki
Рет қаралды 94 М.
I Solved The World's Hardest Maze (with Code)
9:54
Green Code
Рет қаралды 134 М.
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 182 М.
10 Sorting Algorithms Easily Explained
10:48
Coding with Lewis
Рет қаралды 47 М.
How Binary Search Makes Computers Much, Much Faster
6:51
Tom Scott
Рет қаралды 1,4 МЛН
Sorting Algorithms (Bubble Sort, Shell Sort, Quicksort)
12:27
White Chaddar
Рет қаралды 2 МЛН
Why this puzzle is impossible
19:37
3Blue1Brown
Рет қаралды 3,1 МЛН
Google Pixel 9/Pro/Fold Impressions: They've Finally Done It?
13:25
Marques Brownlee
Рет қаралды 6 МЛН
Мой новый мега монитор!🤯
1:00
Корнеич
Рет қаралды 7 МЛН
Слетела прошивка на LiXiang L7
1:01
Настя ЧПЕК Туман
Рет қаралды 3,8 МЛН