You only need to check prime numbers up to the sqrt of the number
@Nick-the-foxМісяць тому
thumbnail:🖼
@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Місяць тому
Don't use actual program notification sounds in a video, I am annoyed.
@DerillPlaysМісяць тому
hmmm game tester here, gonna join DC
@arczi7027Місяць тому
love you groth i see you will be a lot bigger creator in the future with this interesting videos :d
@Chris-wy1whМісяць тому
Well hello Code_Bullet_2!
@saikhrisat1624Місяць тому
I really enjoy watching your video
@GrapeSodaBoiМісяць тому
It was nice working with you dude. Hope your doing well! 😀
@yldzofficialМісяць тому
keep goin mr green code
@abhinavgarg0077Місяць тому
love your videos❤❤❤❤
@LuxciumМісяць тому
Hi! I Love videos about AI and programming :)
@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Місяць тому
Yes this is what I wrote just before subscribing 🎉🎉🎉🎉
@halneufmille2 місяці тому
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.
@Shad0wWarr10r2 місяці тому
in a perfect universe Bogosort wins everytime
@JohnPaulBuce2 місяці тому
thanks
@robotboi7632 місяці тому
now use electron to simulate pythons
@Scar322 місяці тому
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
@sliwkaaa2 місяці тому
5:40 Radix sort is bucket sort and bucket sort is bubble sort
@ziggyzoggin2 місяці тому
Yeah that bugged me too.
@user-sx8kd9hu2s2 місяці тому
this is unfair you should test different case, and radix sort is just fast,but cannot use in real case.
@absentchronicler90632 місяці тому
should've made em race in different categories like: small arrays, almost sorted arrays, extremely large arrays n so on
@Matyanson2 місяці тому
4:45 I wonder how insertion sort would do if binary search were implemented. But probabbly to that much better
@craftydoeseverything97182 місяці тому
Okay, but what about Stalin Sort?
@RysiekOz2 місяці тому
5:43 shouldn't be here bucket and radix(instead of bubble)??
@DM-jc7yi2 місяці тому
what are you using to visualize the sorting algorithms ?
@metalim2 місяці тому
5:41 wrong titles. Should be Radix and Bucket
@lightning_112 місяці тому
Radix sort cheated by looking at the values. Can we get a formal drug use investigation?
@astroorbis2 місяці тому
codebullet but faster uploads, subscribed :3
@alpfalaitzkin832 місяці тому
Where is my favourite sorting algorithm? Stalin Sort would absolutely win!
@andrewevenson26572 місяці тому
I like watching random sorting algorithms, but it’s nice having someone talk about them while I watch
@JensRoland2 місяці тому
Next, make them *arm wrestle*…. Two sorting algorithms, one list; one trying to sort the list ascending, the other descending.
@CaptainJellyBS2 місяці тому
THAT IS SUCH A FUN IDEA!
@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.
@jbrady17252 місяці тому
Hey, if you died today, where would you go? Jesus really is the Way. He still speaks. Seek His voice.
@HmmmmmLemmeThinkNo2 місяці тому
This was a such a blast to watch :D
@HmmmmmLemmeThinkNo2 місяці тому
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
@peppidesu2 місяці тому
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.
@derstreber22 місяці тому
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.
@ThePringels092 місяці тому
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
@isaacsanchez74702 місяці тому
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.
@theopoldthegamer42842 місяці тому
I really like your character, and AAAAH YEAH MERGE SORT LOOKS COOL
@maxwell68812 місяці тому
There should be separate categories for algorithms that need extra memory, and ones that dont.
@Green-Code2 місяці тому
I know, but I didn't want to make the video more complicated
@maxwell68812 місяці тому
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-Code2 місяці тому
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 :)
@puppergump41172 місяці тому
@@Green-Code You could always do it in c++, but then you'd have to rename yourself Red-Code
@maxwell68812 місяці тому
There is a parallel universe where bogo sort won.
@kianchristopher77042 місяці тому
stalin sort going ham
@maxwell68812 місяці тому
@@kianchristopher7704 (Un)fortunately, there is no parallel universe where stalin sort won.
@williamplays04022 місяці тому
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.58922 місяці тому
I went through this exact process
@Green-Code2 місяці тому
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).
@morl12732 місяці тому
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-Code2 місяці тому
Didn't know that. So thank you for the info :)
@Julianiolo2 місяці тому
at 100 elements using threads will probably be slower. Also this is in python where there are no threads :)
@morl12732 місяці тому
@@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.
@morl12732 місяці тому
@@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
@Julianiolo2 місяці тому
@@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.
@aoch14612 місяці тому
Very interesting. Thanks for your work. Looking forward to the next one.