I Made Sorting Algorithms Race Each Other
8:24
AI Learns to Generate Faces
10:03
11 місяців тому
AI Learns to Make Art
8:08
Рік тому
AI Learns What Pizza Is
8:03
Рік тому
AI Learns the Numbers
8:04
Рік тому
I Made A Productivity App
7:08
Simulating Electrons using Python
2:36
КОМЕНТАРІ
@williamsutton6738
@williamsutton6738 16 годин тому
Try the Acorn.
@aoch1461
@aoch1461 Місяць тому
Bravo !!!👏👏👏
@mariovelez578
@mariovelez578 Місяць тому
You only need to check prime numbers up to the sqrt of the number
@Nick-the-fox
@Nick-the-fox Місяць тому
thumbnail:🖼
@drdilyor
@drdilyor Місяць тому
why don't use just run... bfs... it will always find the best solution... and dijkstra is useless because its only useful when edges have weihgts. if the weights are all 1, bfs gets the job done
@SlugCatLife
@SlugCatLife Місяць тому
Don't use actual program notification sounds in a video, I am annoyed.
@DerillPlays
@DerillPlays Місяць тому
hmmm game tester here, gonna join DC
@arczi7027
@arczi7027 Місяць тому
love you groth i see you will be a lot bigger creator in the future with this interesting videos :d
@Chris-wy1wh
@Chris-wy1wh Місяць тому
Well hello Code_Bullet_2!
@saikhrisat1624
@saikhrisat1624 Місяць тому
I really enjoy watching your video
@GrapeSodaBoi
@GrapeSodaBoi Місяць тому
It was nice working with you dude. Hope your doing well! 😀
@yldzofficial
@yldzofficial Місяць тому
keep goin mr green code
@abhinavgarg0077
@abhinavgarg0077 Місяць тому
love your videos❤❤❤❤
@Luxcium
@Luxcium Місяць тому
Hi! I Love videos about AI and programming :)
@Luxcium
@Luxcium Місяць тому
You are a failure with so much motivation and enthusiasm that you are successful and you are not only successful you are good at being successful… You have failed at being a failure tho’ 😅😅😅😅 (3:54)
@Luxcium
@Luxcium Місяць тому
Yes this is what I wrote just before subscribing 🎉🎉🎉🎉
@halneufmille
@halneufmille 2 місяці тому
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.
@Shad0wWarr10r
@Shad0wWarr10r 2 місяці тому
in a perfect universe Bogosort wins everytime
@JohnPaulBuce
@JohnPaulBuce 2 місяці тому
thanks
@robotboi763
@robotboi763 2 місяці тому
now use electron to simulate pythons
@Scar32
@Scar32 2 місяці тому
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
@sliwkaaa
@sliwkaaa 2 місяці тому
5:40 Radix sort is bucket sort and bucket sort is bubble sort
@ziggyzoggin
@ziggyzoggin 2 місяці тому
Yeah that bugged me too.
@user-sx8kd9hu2s
@user-sx8kd9hu2s 2 місяці тому
this is unfair you should test different case, and radix sort is just fast,but cannot use in real case.
@absentchronicler9063
@absentchronicler9063 2 місяці тому
should've made em race in different categories like: small arrays, almost sorted arrays, extremely large arrays n so on
@Matyanson
@Matyanson 2 місяці тому
4:45 I wonder how insertion sort would do if binary search were implemented. But probabbly to that much better
@craftydoeseverything9718
@craftydoeseverything9718 2 місяці тому
Okay, but what about Stalin Sort?
@RysiekOz
@RysiekOz 2 місяці тому
5:43 shouldn't be here bucket and radix(instead of bubble)??
@DM-jc7yi
@DM-jc7yi 2 місяці тому
what are you using to visualize the sorting algorithms ?
@metalim
@metalim 2 місяці тому
5:41 wrong titles. Should be Radix and Bucket
@lightning_11
@lightning_11 2 місяці тому
Radix sort cheated by looking at the values. Can we get a formal drug use investigation?
@astroorbis
@astroorbis 2 місяці тому
codebullet but faster uploads, subscribed :3
@alpfalaitzkin83
@alpfalaitzkin83 2 місяці тому
Where is my favourite sorting algorithm? Stalin Sort would absolutely win!
@andrewevenson2657
@andrewevenson2657 2 місяці тому
I like watching random sorting algorithms, but it’s nice having someone talk about them while I watch
@JensRoland
@JensRoland 2 місяці тому
Next, make them *arm wrestle*…. Two sorting algorithms, one list; one trying to sort the list ascending, the other descending.
@CaptainJellyBS
@CaptainJellyBS 2 місяці тому
THAT IS SUCH A FUN IDEA!
@m4rt_
@m4rt_ 2 місяці тому
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.
@jbrady1725
@jbrady1725 2 місяці тому
Hey, if you died today, where would you go? Jesus really is the Way. He still speaks. Seek His voice.
@HmmmmmLemmeThinkNo
@HmmmmmLemmeThinkNo 2 місяці тому
This was a such a blast to watch :D
@HmmmmmLemmeThinkNo
@HmmmmmLemmeThinkNo 2 місяці тому
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
@peppidesu
@peppidesu 2 місяці тому
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.
@derstreber2
@derstreber2 2 місяці тому
I hate to be a downer, but this is not really an Olympics, this is more like a single race on a track. You could let all of the algorithms go at the same time and see what place they all fall into. (There are many videos on youtube that do just that.) In my way of thinking, a pseudo Olympics would likely have different events that each algorithm takes part in. (More than just random scrambling of a dataset where all of the values are unique.) What about datasets where there are non unique values, and there is a discrete number of possible values. (For example, an array with 100 elements, but each of the elements only have have a value either of 10, 20, 60, or 100.) How about an event where the sort begins normally, but after every N operations, two random elements of the array are swapped. Algorithms that assume to much about what is already sorted will find difficulty here. As of right now I have not seen much of this on youtube. If you did make another video that went through different sorts of benchmarks that would be something that is more unique on youtube.
@ThePringels09
@ThePringels09 2 місяці тому
You can try as you like to beat .sort() it's just sadly impossible because (compared to C[++]) Python runs like my demented old grandma
@isaacsanchez7470
@isaacsanchez7470 2 місяці тому
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.
@theopoldthegamer4284
@theopoldthegamer4284 2 місяці тому
I really like your character, and AAAAH YEAH MERGE SORT LOOKS COOL
@maxwell6881
@maxwell6881 2 місяці тому
There should be separate categories for algorithms that need extra memory, and ones that dont.
@Green-Code
@Green-Code 2 місяці тому
I know, but I didn't want to make the video more complicated
@maxwell6881
@maxwell6881 2 місяці тому
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 2 місяці тому
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 2 місяці тому
@@Green-Code You could always do it in c++, but then you'd have to rename yourself Red-Code
@maxwell6881
@maxwell6881 2 місяці тому
There is a parallel universe where bogo sort won.
@kianchristopher7704
@kianchristopher7704 2 місяці тому
stalin sort going ham
@maxwell6881
@maxwell6881 2 місяці тому
@@kianchristopher7704 (Un)fortunately, there is no parallel universe where stalin sort won.
@williamplays0402
@williamplays0402 2 місяці тому
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 2 місяці тому
I went through this exact process
@Green-Code
@Green-Code 2 місяці тому
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).
@morl1273
@morl1273 2 місяці тому
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 2 місяці тому
Didn't know that. So thank you for the info :)
@Julianiolo
@Julianiolo 2 місяці тому
at 100 elements using threads will probably be slower. Also this is in python where there are no threads :)
@morl1273
@morl1273 2 місяці тому
@@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 2 місяці тому
@@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 2 місяці тому
@@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.
@aoch1461
@aoch1461 2 місяці тому
Very interesting. Thanks for your work. Looking forward to the next one.
@sciencedude200
@sciencedude200 2 місяці тому
nice video, can't wait to see more
@lego_by_leo
@lego_by_leo 2 місяці тому
nice video