I Made Sorting Algorithms Race Each Other

  Рет қаралды 239,595

Green Code

Green Code

Күн бұрын

Пікірлер: 336
@sliwkaaa
@sliwkaaa 9 ай бұрын
5:40 Radix sort is bucket sort and bucket sort is bubble sort
@ziggyzoggin
@ziggyzoggin 9 ай бұрын
Yeah that bugged me too.
@nandishm5489
@nandishm5489 2 ай бұрын
I was about to comment that 😂
@7embersVeryOwn
@7embersVeryOwn Ай бұрын
Why would you phrase it like that?
@bryanoliver6375
@bryanoliver6375 Ай бұрын
As soon as I saw bogo sort I was now way it’d hitting the 1 in 100 factorial chance lol
@shabeer_wms
@shabeer_wms 13 күн бұрын
He got the spirit
@maxwell6881
@maxwell6881 10 ай бұрын
There is a parallel universe where bogo sort won.
@dumbkian
@dumbkian 9 ай бұрын
stalin sort going ham
@maxwell6881
@maxwell6881 9 ай бұрын
@@dumbkian (Un)fortunately, there is no parallel universe where stalin sort won.
@idkwhatnonamemyself1951
@idkwhatnonamemyself1951 6 ай бұрын
Quantum bogosort moment
@poopyfarts6848
@poopyfarts6848 6 ай бұрын
if there are infinite parallel universes, there is a universe where bogo sort always works and nobody knows why
@dannyhoang9623
@dannyhoang9623 6 ай бұрын
Always bet on bogosort
@KebabTM
@KebabTM 6 ай бұрын
So you technically sorted the sorting algorithms
@69k_gold
@69k_gold 4 ай бұрын
That's wild🤣🤣
@largeliji885
@largeliji885 3 ай бұрын
Exactly my reaction when seeing this video😂
@DiverseInBits
@DiverseInBits Ай бұрын
“And I used Quick sort to sort all of these sorting algorithms.
@JensRoland
@JensRoland 10 ай бұрын
Next, make them *arm wrestle*…. Two sorting algorithms, one list; one trying to sort the list ascending, the other descending.
@CaptainJellyBS
@CaptainJellyBS 9 ай бұрын
THAT IS SUCH A FUN IDEA!
@JensRoland
@JensRoland 7 ай бұрын
“Innnn the right corner, built by a team at Google DeepMind, the challenger with four straight victories in a row including two by technical deadlock. This brainy bot will put you Out Of Order, iiiiit’s AlphaSoooooooort!”
@GeminiEntropic
@GeminiEntropic 6 ай бұрын
I need this in my life djshisbd
@farpurple
@farpurple 6 ай бұрын
Somewhat hard with some algorithms, like merge sort it is recursive, maybe each call revert it hm
@adeonn
@adeonn 6 ай бұрын
That would b really funny with bogosort
@morl1273
@morl1273 10 ай бұрын
Should have implemented some of them with threads, as mergesort and quicksort are easy to parallelize and get much faster. For Quicksort, you don't even need synchronization.
@Green-Code
@Green-Code 10 ай бұрын
Didn't know that. So thank you for the info :)
@Julianiolo
@Julianiolo 10 ай бұрын
at 100 elements using threads will probably be slower. Also this is in python where there are no threads :)
@morl1273
@morl1273 10 ай бұрын
@@Julianiolo yes that's true, but this is in general a measurement bias in this tournament. First we need longer numbers, as radix sort is O(n*m) with m being the number of digit's, while for other algorithms the number lengths is irrelevant. Also we need more numbers to gain actual data and we need them tested multiple times to get valuable data.
@morl1273
@morl1273 10 ай бұрын
@@Julianiolo also there are python threads, but they indeed have a problem that they are often not executed in parallel but instead are reduced to linear code execution
@Julianiolo
@Julianiolo 10 ай бұрын
@@morl1273 "threads" in python only help when dealing with i/o and similar, since they cant use multiple cores. Multiprocessing is kind of the equivalent for python, but that has other issues.
@maxwell6881
@maxwell6881 10 ай бұрын
There should be separate categories for algorithms that need extra memory, and ones that dont.
@Green-Code
@Green-Code 10 ай бұрын
I know, but I didn't want to make the video more complicated
@stephenhowe4107
@stephenhowe4107 6 ай бұрын
@@Green-Code And also which sort is stable and which is not. And which sorts have O(N) behaviour if the data is mostly sorted
@isaacsanchez7470
@isaacsanchez7470 10 ай бұрын
Awesome video! I think a potential factor in why the tournament results were a bit off comes from how the n value was changed from bracket to bracket. Because of the different time complexities, some sorting algorithms might work faster with smaller values and so they might start floundering as the list size increases.
@aidantilanus
@aidantilanus Ай бұрын
Bogosort is one of the fastest sorting algorithms if the shuffle is right first try.
@maxwell6881
@maxwell6881 10 ай бұрын
The reason .sort() is faster than the other ones is because it was programmed in C, while the ones you made are in python.
@Green-Code
@Green-Code 10 ай бұрын
Yeah I'm aware :). It's just kinda of frustrating that after learning about sorting algorithms in Python, there's just a function that does it like waaaay better than anything you could do in Python :)
@puppergump4117
@puppergump4117 10 ай бұрын
@@Green-Code You could always do it in c++, but then you'd have to rename yourself Red-Code
@Den_drummer
@Den_drummer 6 ай бұрын
Love content like this.... But I have one critique that was not mentioned in the video afaik. There's no "one size fits all" sorting algorithm, though some algorithms certainly are better than others in the majority of cases. Parameters like the size of the list, the type of data in the list and how the data in the list is ordered can make a major difference for example, as I'm relatively sure the wikipedia page on sorting algorithms points out. A truly fair competion as I see it would have categories. In one axis short, medium and long distance (aka n. I'd say n=1.000, n=100.000 and n=10.000.000), in another axis swimming, running and cycling (objects, strings and integers) and in the final axis a suny day, a windy day and a stormy day (almost sorted, fully random and p much reverse order). That being said, keep up the good work. ( ^ v^)b Ps: poor bogosort being called the worst when bogobogosort exists :P EDIT: meant to send as original post not reply xD oh well too late
@waveplasma1369
@waveplasma1369 6 ай бұрын
@@Green-Code It also uses timsort or powersort which are slightly better versions of mergesort!
@alansmithee419
@alansmithee419 5 ай бұрын
@@Den_drummer Don't forget quantumbogosort. Randomise the list. In at least one universe (as per many worlds interpretation) the list is now sorted. If it is not sorted, destroy the universe you are in. You are now left in a universe where it is sorted (as per quantum immortality).
@aoch1461
@aoch1461 10 ай бұрын
Very interesting. Thanks for your work. Looking forward to the next one.
@Kristanoppersma
@Kristanoppersma 6 ай бұрын
Me: can we have code bullet? Mom: we have code bullet at home. Code bullet at home:
@Kristanoppersma
@Kristanoppersma 6 ай бұрын
Great Video though
@noahscott4096
@noahscott4096 6 ай бұрын
I was gonna say. Kinda like code bullet without the depression.
@DiceGmd
@DiceGmd 6 ай бұрын
But still.. This guy is SICK.
@TeeJizzm
@TeeJizzm 2 ай бұрын
All this guy needs to do is upload more than once every 6 months and he has Code Bullet beat
@theopoldthegamer4284
@theopoldthegamer4284 10 ай бұрын
I really like your character, and AAAAH YEAH MERGE SORT LOOKS COOL
@redder358
@redder358 6 ай бұрын
You should make different categories with different amounts of elements, for example 10, 100, 1k, 10k, 100k, ... and see how for example insertion sort dominates everything for the lowest category (if it is few enough elements), then quicksort dominates everything in the middle and then the big O complexity of radix sort enables it to outrun everyone else. Also, it would be in the spirit of Olympics because there are different sports (= different categories) Nice video though, you deserve way more subscribers!
@redder358
@redder358 6 ай бұрын
Oh and maybe in the future, you could host some competition where people send their algorithms and you let them run and compare them, similar to what Sebastian Lague did with chessbots last summer. That way you would have plenty of algorithms and it could be a really interesting content that I have never seen before on KZbin.
@m_affiliates
@m_affiliates 5 ай бұрын
@@redder358imagining the winner would be some maniac who wrote both a compression and decompression algorithm and packaged holygrailsort into 2KB
@Shad0wWarr10r
@Shad0wWarr10r 9 ай бұрын
in a perfect universe Bogosort wins everytime
@amthystxx
@amthystxx 2 ай бұрын
The coolest part of this idea is that the people in this universe would have no idea why it’s always correct, it’d be a mystery.
@chiragbellara5221
@chiragbellara5221 6 ай бұрын
You should host a Nerd Olympics. I had never been more excited to watch sorting algorithms in my life! Good video.
@GPSdotGlitch
@GPSdotGlitch 6 ай бұрын
I agree 100%
@HmmmmmLemmeThinkNo
@HmmmmmLemmeThinkNo 10 ай бұрын
This was a such a blast to watch :D
@The-EJ-Factor
@The-EJ-Factor Ай бұрын
6:32 problem is that by selecting a bad pivot, quick sort could end up with O(n^2) time, so on average it would win but it could also lose, meanwhile the other algorithm is consistent.
@K1nggor1
@K1nggor1 Ай бұрын
I didn't knew this channel existed. That is a really good work. I presented it to beginners and they absolutely love it as I do. Directly subscribed. You need a really good job on this!
@reludas
@reludas 2 күн бұрын
theres a universe where bogo sort is always the fastest.
@andrewevenson2657
@andrewevenson2657 10 ай бұрын
I like watching random sorting algorithms, but it’s nice having someone talk about them while I watch
@alian713
@alian713 4 күн бұрын
4:46 the insertion sort implementation here uses linear insertion, which is actually O(n^2) in the worst case time complexity (starting array is in descending order) it may have won against merge sort if it were implemented with binary search insertion. Also, fun fact about these two algorithms: with smaller arrays, insertion sort is faster than merge sort, but for larger arrays merge sort is much faster so a very clever sorting algorithm is to split an array into chunks, sort the chunks using insertion sort and then merge them all back into the final array. This is called Tim sort and is what's used by python's `sorted()` function
@The-EJ-Factor
@The-EJ-Factor Ай бұрын
1:32 well it may seem fast but technically a human can sort in O(n) time only having to look at numbers once, the main problem is how long the O part is.
@backfire8744
@backfire8744 29 күн бұрын
As someone who just started learning Python (transitioning from MATLAB) it was super neat to see the syntax for the different scripts. Thanks!
@mciek3306
@mciek3306 5 ай бұрын
5:50 got me so confused, you speak about radixsort while showing bubble sort and bucket sort 😅
@shubhamnanche
@shubhamnanche 4 ай бұрын
Exactly 💯
@Infin1ty0
@Infin1ty0 3 ай бұрын
According to what I saw, he only forgot to rename the algorithms. Left is radixsort and right is bubble sort
@jyotiradityashukla4569
@jyotiradityashukla4569 5 ай бұрын
This deserves more views. As a programmer, this is pretty investing and cool
@alian713
@alian713 4 күн бұрын
7:53 I believe merge sort is the only algorithm that can be parallelized for absurdly huge lists that need to be sorted, so it's still a winner at the end of the day... *looks at bogo sort*.
@user-lh2fr6xy1o
@user-lh2fr6xy1o Ай бұрын
so cool to see the pivot visually move as quicksort shoves everything above/below it
@williamplays0402
@williamplays0402 10 ай бұрын
at 5:40 I think you chose Bubble sort instead of Radix sort EDIT: What was I thinking? It just says Bubble sort at the top, but the algorithm itself is Radix sort. EDIT 2: As I continued to watch the video, I realised that that whole section is quite confusing.
@londonl.5892
@londonl.5892 10 ай бұрын
I went through this exact process
@Green-Code
@Green-Code 10 ай бұрын
Yeah sorry about that :/. The editing for this video was a bit gruelling and I forgot to change the names of the algorithms (although the algorithms themselves are the correct ones).
@pushkal8800
@pushkal8800 5 ай бұрын
Bro fire video too too good loved it man the visualizing idea and the meme olympics way too good, love you brother
@peppidesu
@peppidesu 10 ай бұрын
Why we have all of these to begin with: - some algorithms are what we call "stable". this means that the order of elements that have the same value for the property we are sorting on does not change - some algorithms work in-place, whereas others need to make a copy of the list. Algorithms that are not in-place use more memory and sometimes don't utilize CPU cache well. - the speed of an algorithms sometimes depends on what list you are sorting. Quicksort has a best-case time complexity of O(n log n). but it can perform as bad as O(n^2), if the list is organized such that the chosen pivot is a minimum or a maximum of the current slice. Merge sort on the other hand, has a time complexity of O(n log n) no matter what. - Finally, radix sort is a bit different from the rest. It performs O(nk), where k is the average number of digits a number has in the list. But the trouble is that radix sort is unwieldy to implement when you want to sort data that isn't plain integers or strings. also, if your list is small and your number of digits high, radix sort can be as bad as bubble sort.
@LucaArtc
@LucaArtc 2 ай бұрын
3:45 really cool name😂
@snacku7
@snacku7 Ай бұрын
Specifically, the more common radixsort is LSD radixsort, but MSD radixsort is somewhat common too. Least significant digit is what was used in the video, a unique effect is those last three iterations with the stair-looking things.
@chicken__nugets
@chicken__nugets 10 ай бұрын
gg man love the video
@mrhangertv1829
@mrhangertv1829 5 ай бұрын
2:30 Actually, Bogo Sort's best case cenario is when the list is already sorted taking n-1 comparisons and could technically win and Merge Sort... 6th.
@ghb323
@ghb323 5 ай бұрын
1:49 it's upside-down because the Y axis is orientated downwards. 2D graphics are like this probably because computers handle ordered things from left-to-right and top to bottom, like text.
@auaisme
@auaisme 2 ай бұрын
I just wanna point out a few things: * Merge Sort is the best algorithm here. It is a comparison based algorithm, so it works for all values that can be compared including strings. It is actually faster than Quick sort. It runs in n log2 n in the WORST case, which is very fast. Quick sort runs in n loge n on average but slows down to n^2 in the WORST case. * Count sort is one of the fastest sorting algorithms out there, but it's not comparison based. It runs in n time in the worst case, which means that it will take about as much time as it takes to look at the entire input data. * Lastly, each algorithm exists for a specific purpose. Sometimes, you can use Count sort, but mostly you can't. It's not as simple as which is the fastest. Merge sort is, in my opinion, the best. PS: Radix sort and Postman sort are an extension of Count sort.
@Albericbaboin
@Albericbaboin 5 ай бұрын
It is also important for the move ordering in the minimax with AB pruning
@m4rt_
@m4rt_ 10 ай бұрын
Every sorting algorithm has it's advantages and disadvantages, so it depends on the situation. If you have always a lot to sort, then one algorithm may be better, while if you have small amounts of data to sort, then another one may be better, etc. Also, even if algorithms have the same time complexity, they may differ with how good the best case is, etc. Also, just because one algorithm has a better time complexity, it may be worse than one with a worse time complexity if it does a lot of expansive calculations, and the one with the worse time complexity does less expensive calculations. ... Though bogo sort is always bad.
@dirac1425
@dirac1425 2 ай бұрын
Since my 3rd year in Computer Science, Merge Sort become my favorite sort algorithm
@preciouscronicle
@preciouscronicle 9 күн бұрын
I thought of one: check the biggest digits, then do the smaller ones.
@SP.Learning
@SP.Learning 2 ай бұрын
Bro gon ace every job interview
@會寫程式的羊
@會寫程式的羊 9 ай бұрын
this is unfair you should test different case, and radix sort is just fast,but cannot use in real case.
@thomaspacheco558
@thomaspacheco558 Ай бұрын
.sort() in python, it uses "tim-sort" and it contains a mix between merge sort and insertion sort.
@toy-x6q
@toy-x6q 5 ай бұрын
you should inplement sleep sort, with multi threading as it is fastest with small datasets, also at 5:49, it reads bucket sort, when its radix sort
@goodtheme-wl1he
@goodtheme-wl1he Ай бұрын
0:46 and, sorting algorithms are used ale the time! when you're on ebay, and you hit sort price low to high, it will use a sorting algorithm, and yeah, you get the point.
@scyye-gaming
@scyye-gaming 18 күн бұрын
wait? when you sort, it sorts? holy crap!
@goodtheme-wl1he
@goodtheme-wl1he 18 күн бұрын
@ sort sorts.
@enzzz.h
@enzzz.h Ай бұрын
you are a crazy guy how tf do you have patience to do all of it ?
@veitkunz9524
@veitkunz9524 2 ай бұрын
Bogo can, potentially, be the fasted one. It could happen that it just needs a single iteration.
@xavierdupont5772
@xavierdupont5772 4 ай бұрын
You seem to be having fun. What if you are sorting containers in a port. Now what matters is not really the number of swaps, but the total distance that the crane will have to travel because that crane is really slow. Is that going to impact which algorithm wins? I think it's time for container sort Olympics 😅
@aryanpal6916
@aryanpal6916 2 ай бұрын
Now you pushed me in the dillema that what algo does the sort function use to be fastest of all other algos
@Zitrone21
@Zitrone21 5 ай бұрын
Actually, many sorting algorithms have complex behaviors, being able to detect when a sub set is getting slow, when that happens the sorting strategy changes
@pushkal8800
@pushkal8800 5 ай бұрын
Get this man a million subscribers
@SirCluckety
@SirCluckety 2 ай бұрын
This video explains in full detail why I am single
@berryesseen
@berryesseen Ай бұрын
Bogosort just needs a little bit of luck just like me needing it to beat Steph Curry in a 3 point contest.
@zix2421
@zix2421 5 ай бұрын
5:07 was kinda best, I guess
@HmmmmmLemmeThinkNo
@HmmmmmLemmeThinkNo 10 ай бұрын
While this is small enough that they probably won't bother you, I did want to let you know that the Olympics is a trademarked or copyrighted thing and they _do_ go after some creators. The one I'm thinking of is a really big one, the MarbleLympics (now Marble League). Not a criticism or saying you should change anything. Just thought I'd shoot you an fyi
@sg9257
@sg9257 4 ай бұрын
Bogo sort has the potential to sort an array in linear time but it has one in billion chance of doing it.
@Matyanson
@Matyanson 9 ай бұрын
4:45 I wonder how insertion sort would do if binary search were implemented. But probabbly to that much better
@coneforest9308
@coneforest9308 4 ай бұрын
There is a talk by Andrey Alexandrescu, in which he briefly discusses it. Basically it's only faster for large arrays. The reasons are complicated, it's better to watch the original talk
@FNaF-Fan-8893
@FNaF-Fan-8893 2 ай бұрын
I didn't understand a word you said, but I was greatly intrigued.
@EnerJetix
@EnerJetix 5 ай бұрын
Quick sort and Merge sort are the GOATs
@ProgrammerPenguin
@ProgrammerPenguin 4 ай бұрын
5:40 its supposed to be radix vs bucket. but eh who cares, good vid my dude!
@holophs
@holophs 5 ай бұрын
Some algorithms work quicker in large data, some work faster with less data.
@afartingguy8541
@afartingguy8541 4 ай бұрын
yo the radix sort vs bucket sort part had the names from the previous round, make sure to watch your video before uploading
@itsjustmusic1591
@itsjustmusic1591 2 ай бұрын
Add parallelism to merge sort for large amounts of elements.. and it rips everything else ☠️
@Infinitelucidmaze
@Infinitelucidmaze 6 ай бұрын
Wow I actually was using a shitty sorting algorithm when I was scripting and ordering an array that had distances, I learned something...
@piyusharora5327
@piyusharora5327 4 ай бұрын
I now discover that there is something worse than bubble sort.
@AlfredoOrozcoVideos
@AlfredoOrozcoVideos 4 ай бұрын
Loved this video !!!!!!!!!!!
@ImpossibleEvan
@ImpossibleEvan 27 күн бұрын
Could you tell me what python module you use for the graphics?
@SkyboxMonster
@SkyboxMonster 23 күн бұрын
Interesting. I have been developing a hardware level sorting technique, but I have been unable to finish my proof of concept because lack of software tools to emulate it. I am certain that its time to sort a list of numbers would be much faster than software implementations. since it does not use the CPU or RAM during the sort itself.
@WTIF2024
@WTIF2024 2 ай бұрын
I did something like this for my 7th grade research project.
@doktorhosenlos5490
@doktorhosenlos5490 4 ай бұрын
actually the shakersort is one of the fastest sorting algorithms when it comes to a bigger dataset
@PranavMaddineedi
@PranavMaddineedi 5 ай бұрын
You should add Counting Sort. It only works for positive integers (can easily be modified for negatives) though.
@kennymishatylergamingeeee5183
@kennymishatylergamingeeee5183 3 ай бұрын
the only reason comb sort didn't make it to quarterfinals is because its opponent was radix sort
@halneufmille
@halneufmille 9 ай бұрын
Radix is an odd one there. There is a way to make it super slow with complicated data, or super fast with very simple inputs. I would say quicksort is the champion of the comparison sorts.
@tahaazmat730
@tahaazmat730 5 ай бұрын
where were you when i was getting cooked in DATA STRUCTURES & ALGORITHMS
@spencernaugle
@spencernaugle 3 ай бұрын
You're a Fan of Code Bullet I see... Good taste.
@kyaki101
@kyaki101 4 ай бұрын
Radix sort is good in these cases, where data is in a small range of numbers, because it’s complexity is o(n + k) where k is the number of bits, but it isn’t good for large ranges, so the test case isn’t fair
@osys7832
@osys7832 6 ай бұрын
The fact that bogosort is the fastest sorting algorithm in a quantum computer or an hpc system where all possibilities are tried by each computing unit at the same time 😎
@YO-BIZZY
@YO-BIZZY 2 ай бұрын
3:36 recursive means space complexity is not constant, right?
@JessicaBorisov
@JessicaBorisov 2 ай бұрын
those sounds are giving me anxiety
@Pincapybara
@Pincapybara 5 ай бұрын
You really put your Channel Description in binary😂 I respect that.
@37.nguyenvukhoinguyen20
@37.nguyenvukhoinguyen20 5 ай бұрын
Remember, bogosort has an 1/100! chance to instantly win
@_GhostMiner
@_GhostMiner 5 ай бұрын
Some of those poses look quite similar to Code bullet 😉
@guyg.5013
@guyg.5013 6 ай бұрын
you haven't tried Wikisort or Grailsort? they are modifications of mergesort that are supposed to be fast, stable, and need no memory.
@paulstelian97
@paulstelian97 6 ай бұрын
They're also awfully complicated to implement.
@bartoszgowacki3086
@bartoszgowacki3086 5 ай бұрын
I'm also fan of merge sort and I even noticed at the begining of the video that you were using mergesort as example animation. You should try non-recursive version of it which is much faster, also you can make it even faster if you are using hybrid algorithm. You can first sort every for example 32 numbers using insert sort which is faster for smaller data (I didn't test if 32 is optimal it's just example) and then from that moment you can start merge sort. also it should be better to test it in compiled language like C, C++ or Rust because python has hudge overhead (it is possible for python algorithm to work even 40 or more times slower!) and this overhead can potentially be different for different algorithms.
@ezkkjj
@ezkkjj 3 ай бұрын
5:46 it says bucket sort over radix sort and bubble sort over bucket sort
@absentchronicler9063
@absentchronicler9063 9 ай бұрын
should've made em race in different categories like: small arrays, almost sorted arrays, extremely large arrays n so on
@MSAWCartoonist
@MSAWCartoonist 5 ай бұрын
from one mergesort enjoyer to another 🤝
@Scar32
@Scar32 9 ай бұрын
i have a bit of thoughts on this video 1. those single letter variables.... 2. yes i love comb sort or shell sort... idk it's hard to tell them apart Ӡ. pretty sure radix sort screws up when sorting floating point numbers 4. that pixel font has no descenders... AHHHHH
@RP-Rentner
@RP-Rentner Ай бұрын
Radix was my fav and i'm happy with the result
@mohammadmohabsarhan3961
@mohammadmohabsarhan3961 2 ай бұрын
Next, try different data distributions, algorithms performance differ with it.
@delictum000
@delictum000 5 ай бұрын
green code do you not realize at 5:40 you put bucket sort and bubble sort together from their titles above instead of "Radix sort" and "Bucket sort"
@Akct123
@Akct123 Ай бұрын
.sort() uses Tim Sort Algorithm hybrid of Merge and Insertion Sort
@Aman16usa
@Aman16usa 6 күн бұрын
In the semi finals you put bucket vs bubble when it should’ve been radix vs bucket
@saudenamente9963
@saudenamente9963 Ай бұрын
Love U bro
@jacobD643
@jacobD643 29 күн бұрын
as a software engineer, it bugs me a bit that you didn't specify that the ranking of the algorithms are specifically for the amount of values you had, because of the O() notation, that is useful for large values of n and better algorithms like quicksort and merge sort are generally weaker when there's no a lot of data, but dominates for larger amounts, which would explain why comb-sort came before merge sort and quick sort in your test.
@ishu4227
@ishu4227 6 ай бұрын
5:40 ARREST BUCKET SORT AND RADIX SORT THEY COMMITTED IDENTITY THYEFT !!!!
@anon_y_mousse
@anon_y_mousse 5 ай бұрын
Makes me want to write my own test, but in C. I figure I could either visualize it with colored terminal output, or alternatively use RayLib.
@Structed-2
@Structed-2 2 ай бұрын
Thank you Code Bullet! Wait... Wrong channel sorry.
@michalatlas2865
@michalatlas2865 6 ай бұрын
Loved your video. Just tiny notes, Bucket sort is faster partly because it's a different class, The others presume your only operation is Comparisons. Bucket sort as you mentioned uses some element inspection which makes it leaps better, actually Counting sort might be the best here, since it'd sort the array in O(n) (not even that just plain 2n+c, I think), but in usual general cases where these are compared these two cannot be applied, which doesn't mean ofc that they aren't awesome, useful and shouldn't be mentioned. Second "like not supposed to be that good" is referring to asymptotic complexity which assumes the length of your inputs "approaches infinity". So sometimes bubble sort wins if you have like 3 elements. To make this fair and interesting you have to do probably millions of elements, otherwise the constants in those algorithms might trump the asymptotic complexity itself (which I guess depends if is relevant to you)
@mrmurpleqwerty4838
@mrmurpleqwerty4838 6 ай бұрын
hey uhh fun fact radix sort was invented *_B E F O R E C O M P U T E R S_*
@EE-ue8mj
@EE-ue8mj 2 ай бұрын
So this guy is bullet code with a different accent
I Solved The World's Hardest Maze (with Code)
9:54
Green Code
Рет қаралды 217 М.
I Used Code to Go Viral on Social Media
8:54
Green Code
Рет қаралды 251 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 695 М.
1% vs 100% #beatbox #tiktok
01:10
BeatboxJCOP
Рет қаралды 62 МЛН
10 FORBIDDEN Sorting Algorithms
9:41
Ardens
Рет қаралды 942 М.
AI Learns What Pizza Is
8:03
Green Code
Рет қаралды 351 М.
Visualizing 70 Sorting Algorithms
29:24
Kuvina Saydaki
Рет қаралды 217 М.
The Bubble Sort Curve
19:18
Lines That Connect
Рет қаралды 698 М.
I Built a Neural Network from Scratch
9:15
Green Code
Рет қаралды 454 М.
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 274 М.
I Made A VideoGame in 48h
9:49
Green Code
Рет қаралды 20 М.
I Made an AI with just Redstone!
17:23
mattbatwings
Рет қаралды 1,2 МЛН
One second to compute the largest Fibonacci number I can
25:55
Sheafification of G
Рет қаралды 425 М.
Арыстанның айқасы, Тәуіржанның шайқасы!
25:51
QosLike / ҚосЛайк / Косылайық
Рет қаралды 695 М.