Merge Sort vs Quick Sort

  Рет қаралды 1,322,825

udiprod

udiprod

Күн бұрын

Пікірлер: 922
@sebastianmorataboada9795
@sebastianmorataboada9795 5 жыл бұрын
"hey dude what sports do u watch" me: *_sweats nervously_* thx my folks for the correction
@mariafe7050
@mariafe7050 5 жыл бұрын
me: Sorting algorithms! "what"
@mariafe7050
@mariafe7050 5 жыл бұрын
It's been 1 month since I replied but I never noticed the misspelling of 'nerviously'. It's supposed to be 'nervously'. How did I not notic that?
@xl000
@xl000 5 жыл бұрын
said who ?
@whiskeyburns5230
@whiskeyburns5230 4 жыл бұрын
lets play cricket
@mryup6100
@mryup6100 4 жыл бұрын
@Commenter in a Box r/wooosh time!
@pelerflyp5398
@pelerflyp5398 4 жыл бұрын
“Instead of relying on miracles...” Bogo sort: 😥
@XPForever
@XPForever 4 жыл бұрын
XD
@astro_cat030
@astro_cat030 2 жыл бұрын
its rare
@tesseract7586
@tesseract7586 2 жыл бұрын
yes that is true
@xevento8682
@xevento8682 Жыл бұрын
MiracleSort: 😥
@nif0
@nif0 Жыл бұрын
@@astro_cat030 you just don't believe enough
@kenners1993
@kenners1993 8 жыл бұрын
Can we get bogosort?
@udiprod
@udiprod 8 жыл бұрын
There's definitely a popular demand for this algorithm, so I'm starting to think seriously about it. May I ask why you are interested in this particular algorithm?
@kenners1993
@kenners1993 8 жыл бұрын
udiprod Just because it would be interesting to see it animated, because it does not work with any rhyme or reason. It would be fun to watch.
@udiprod
@udiprod 8 жыл бұрын
Ok, thanks for the input. I'll certainly think about it.
@Dude7469
@Dude7469 8 жыл бұрын
I think it's about highlighting the part where bogo sort actually fails. Yes, we know the outcome that it doesn't work, but exactly at what point does it fail?
@ophello
@ophello 8 жыл бұрын
Dude7469 it doesn't "fail" so much as it's completely braindead. All it does is shuffle the objects randomly until it gets sorted by complete accident. There's really no point in animating something so stupid. Bogo sort is the worst possible sorting algorithm, but even bogo would eventually, given enough time, accidentally resort the list. If your list only had three items, for example, it would only take a few random shuffles to get it in order. But then imagine reshuffling a deck of cards over and over. You'd be shuffling those cards for billions of years before getting them back into order using bogo sort.
@ihavetwofaces
@ihavetwofaces 5 жыл бұрын
I’ve seen multiple visualizations, code implementations, and descriptions of Merge sort before now. I still had almost no understanding of the core mechanic. After watching this video, I understand it perfectly, and see now how simple it is. This is a fantastic visualization. Thank you!
@uknownada
@uknownada 5 жыл бұрын
It's probably because this series of videos shows a practical way these algorithms are done. It's way easier to understand when you actually SEE it happen. You can do all of this in real life. I wish they could do this with the harder to understand sorts, like Gravity Sort.
@smaybius
@smaybius 2 жыл бұрын
@@uknownada Sorts like gravity involve altering the values of items instead of redistributing the items
@Eknoma
@Eknoma 2 жыл бұрын
@@uknownada Gravity sort sorts the elements by by placing beads on the first n poles for each number n in the list, then lets them fall. Simple as that.
@antonliakhovitch8306
@antonliakhovitch8306 2 жыл бұрын
Merge sort was taught to me with a recursive implementation from the start, and that made it very confusing (no, despite what fans of certain languages will tell you, recursion is not "actually super intuitive and efficient"). It makes so much more sense when it's first explained like this, and *then* you're shown recursive pseudocode.
@smaybius
@smaybius 2 жыл бұрын
@@Eknoma You could watch my video on "23 minutes of distributive sorts" and skip to the part with gravity sort. Simplified gravity is also a way of representing gravity sort
@GretgorPooper
@GretgorPooper 7 жыл бұрын
I skipped class, and now I'm cheering on cute little robots running sorting algorithms. What the hell is wrong with my life?
@StevenAkinyemi
@StevenAkinyemi 7 жыл бұрын
Gretgor LOL Everything basically.
@GretgorPooper
@GretgorPooper 7 жыл бұрын
I know that.
@zzZAnubisZzz
@zzZAnubisZzz 6 жыл бұрын
@@GretgorPooper How wrong is your life now? Doing any better?
@daydodog
@daydodog 6 жыл бұрын
are you at least a compsci student?
@bukujuku1541
@bukujuku1541 5 жыл бұрын
@@daydodog electrical engineering do this aswell
@CocoTheMii
@CocoTheMii 4 жыл бұрын
This is actually a really good way of explaining sorting methods.
@vekmogo
@vekmogo Жыл бұрын
I wanted to see Quick Sort deal with a perfectly sorted list at the beginning lol
@Kneedragon1962
@Kneedragon1962 10 жыл бұрын
When introduced to the common sorts, we saw animated demonstrations much like this, with various data set sizes. With small groups, bubble sort is actually quite good. Go to 100+ in a group, and suddenly you see why it's called quicksort. With small groups, quicksort doesn't seem all that clever, but when the group size goes up, it gets very much better.
@udiprod
@udiprod 10 жыл бұрын
You can see in the quicksort vs bubblesort video. Already at 10 elements quicksort is much better than bubblesort: kzbin.info/www/bejne/l4m7iIuwatd5bJY
@Kneedragon1962
@Kneedragon1962 10 жыл бұрын
udiprod Then I think the 'random' group was set up. As a general rule, quicksort isn't that special on small groups. Sometimes, yes, but not consistently. Go to a bigger group, and it's blindingly obvious. It's so much better it's staggering. Also, much is made here of the number of comparisons. That alone doesn't tell the story. It's one part. Bubblesort isn't slow because of comparisons. It's slow because the number of operations is much higher. Comparisons are one operation. Quicksort seems like a somewhat more complicated algorithm, intuition wouldn't tell you how much better it is. Still, thank you for making these and sharing them.
@udiprod
@udiprod 10 жыл бұрын
Kneedragon1962 You are right that on very small groups quick sort's advantage won't be noticed, but on 10 it's already very much noticed. The random permutation wasn't set up. You're also right that comparisons is not the whole story. The competition shown in the video is in fact composed of several elements. For example, it takes time for the robots to move from side to side. Interestingly, in the quick-vs-bubble competition, quicksort spends more time on moving, so you can see bubblesort makes more comparisons per-second than quick sort. This effect is sometimes seen in real life as well. Thanks for watching and for interesting comments.
@antonliakhovitch8306
@antonliakhovitch8306 2 жыл бұрын
@@udiprod It would be helpful if, in the description or accompanying discussion, there's a breakdown of what represents what (for us computer nerds). For instance - what about the robot moving side to side? In the video, it seems like it's at a constant velocity, but really one would expect to see constant *travel time* (or a far more complex pattern if the dataset is bigger than the L1 cache). Clarifying the assumptions made and whatnot (just a little bit beyond what's in the discussion) would be helpful.
@ashutoshmahapatra537
@ashutoshmahapatra537 Жыл бұрын
@@antonliakhovitch8306 agree!
@LetsPlayKradnium
@LetsPlayKradnium 8 жыл бұрын
I watched "We are number one but every "one" is replaced by a sorting algorithm" and now this is all I get in my recommended box
@tttc
@tttc 8 жыл бұрын
It seems lately I keep getting bombarded with recommendations that are somewhat similiar to another videos watched....
@AlexVasiluta
@AlexVasiluta 7 жыл бұрын
「Look over here!」 we too
@josgeerink9434
@josgeerink9434 7 жыл бұрын
K
@milkywaylibrary
@milkywaylibrary 7 жыл бұрын
holy shit 😂
@cutekitty2358
@cutekitty2358 7 жыл бұрын
Brilliant
@Muffinlicioification
@Muffinlicioification 5 жыл бұрын
the little sound that the balls make when being pushed back on the shelf is satisfying
@WeevilLover9000
@WeevilLover9000 4 жыл бұрын
You know you reached the peak of entertainment when you make videos of sorting robots battling while you narrate it with the voice of someone in a child's learning program
@MI-lo2hj
@MI-lo2hj 3 жыл бұрын
you know your in the peak of depression when your watching 2 robots sort balls
@torkakarshiro5170
@torkakarshiro5170 2 жыл бұрын
@@MI-lo2hj ...or you are somebody from the nerd corner that wants to understand algorithms.
@Uejji
@Uejji 8 жыл бұрын
The nice thing about quicksort is that once the nth pivot is correctly positioned, a 2^n-1 additional robots can be brought in to help with the sorting. As long as they stay partitioned by the positioned pivots, they will not interfere with each other. (This of course approximates parallelized sorting using quicksort)
@AlexanderPavel
@AlexanderPavel 7 жыл бұрын
Uejji Mergesort can also be parallelized at the beginning and only needs to drop to single threaded in the end, kind of like quicksort but in reverse
@groszak1
@groszak1 5 жыл бұрын
@@AlexanderPavel and bitonic sort can always be parallelized
@MinecraftLD10
@MinecraftLD10 5 жыл бұрын
Uejji Except will robot A like robot B messing with his desk? I think not.
@Alex-dn7jq
@Alex-dn7jq 7 жыл бұрын
Windows defragmenter uses merge sort. But instead of having a second shelf (or, in this case, disk) it moves files to the end of the partition, separating them using the empty space between them. That's why a good defragment process requires lots of free space.
@deyannick
@deyannick 10 жыл бұрын
Studying computer sciences, I wished I had seen this video before, didn't really understand merge sort only by code, but this makes everything perfectly clear!
@happycord3613
@happycord3613 5 жыл бұрын
*"remove the darker one"*
@huyphamuc6372
@huyphamuc6372 5 жыл бұрын
Okay now I'm rethinking about this video's moral lesson
@TheZincMaster-on1fy
@TheZincMaster-on1fy 5 жыл бұрын
@@huyphamuc6372 I don't think she means it like that
@oscarnival6164
@oscarnival6164 4 жыл бұрын
LMFAO
@mtsimlover2
@mtsimlover2 4 жыл бұрын
THATS RACIST
@monickverma2944
@monickverma2944 4 жыл бұрын
😂
@TheRealTRackard
@TheRealTRackard 8 жыл бұрын
What an odd way to teach programming concepts.
@dcs_0
@dcs_0 6 жыл бұрын
it works though! :D
@abandoned7501
@abandoned7501 6 жыл бұрын
What an even way to teach programming concepts.
@Chowow
@Chowow 5 жыл бұрын
At least we get it
@bigdoggetom6549
@bigdoggetom6549 5 жыл бұрын
Especially if the language you use just has array_sort as a function and no other choice
@triplef3v3r
@triplef3v3r 5 жыл бұрын
odd? what the hell.. you will never find another more clear explanation about sorting...
@whyttea394
@whyttea394 4 жыл бұрын
One of a better explanations I could find online. Great job. Thank you guys!
@pangpengmaster
@pangpengmaster 9 жыл бұрын
This is so cute.
@ВКТС-б3п
@ВКТС-б3п 5 жыл бұрын
no.
@SRBAnimate
@SRBAnimate 5 жыл бұрын
t p o s e
@alanbam5590
@alanbam5590 4 жыл бұрын
Loser
@sirisoj
@sirisoj 4 жыл бұрын
agreed.
@aalforhad
@aalforhad 10 жыл бұрын
your method of explanation is amazing
@da_bes
@da_bes 8 жыл бұрын
how did i get here
@einsteinsemut
@einsteinsemut 8 жыл бұрын
lol , ikr
@aurelia65536
@aurelia65536 8 жыл бұрын
Sflot Yes you did, you friccin moron.
@KEL5isGodrules
@KEL5isGodrules 8 жыл бұрын
oh fricc
@lelcat8414
@lelcat8414 7 жыл бұрын
It was recommended because enough people liked this video who also liked other videos with some qualities similar to other videos you have watched and liked. The process is called collaborative filtering, which is a machine learning algorithm that infers some abstract features of a video from correlation of user preferences, and uses those features (and your preferences) to characterize you as a user. (It is also possible that the recommendation system is content-based, i.e. meta-data associated with this video is similar to other videos you have liked or watched recently.)
@mariafe7050
@mariafe7050 5 жыл бұрын
Because you clicked here dummy
@campbellmcternan3902
@campbellmcternan3902 5 жыл бұрын
Video: *was uploaded 5 years ago* KZbin algorithm 2019: *Oooooh yeah he’ll love this randomly*
@jontymorris8200
@jontymorris8200 5 жыл бұрын
But you clicked it didn't you!?
@campbellmcternan3902
@campbellmcternan3902 5 жыл бұрын
Jonty Morris 🤫 of course not
@DocktorFurioustank
@DocktorFurioustank 3 жыл бұрын
and here I am in 2021
@user-zi7kp8un3s
@user-zi7kp8un3s 8 ай бұрын
Comment from 5 years ago now lol, means video 10 years ago
@campbellmcternan3902
@campbellmcternan3902 7 ай бұрын
@@user-zi7kp8un3s that's crazy thanks for reminding me :)
@huyphamuc6372
@huyphamuc6372 5 жыл бұрын
it's 2019 and I finally found a channel that animates algorithms in such an easy way. Subbed
@HallidayASR
@HallidayASR 7 жыл бұрын
@张弼-i7h
@张弼-i7h 6 жыл бұрын
me too
@mariafe7050
@mariafe7050 6 жыл бұрын
Donovan A S R Which match?
@dancingbread7015
@dancingbread7015 6 жыл бұрын
Same
@sangramjitchakraborty7845
@sangramjitchakraborty7845 5 жыл бұрын
I was Q team. I love how simple quicksort is.
@dv_xl
@dv_xl 5 жыл бұрын
@@sangramjitchakraborty7845 I think most people would say merge sort is conceptually simpler than quicksort
@tsumikiminiwa4603
@tsumikiminiwa4603 3 жыл бұрын
I'd actually be interested in a multi threaded comparison of this and quick sort. Merge sort can multitask at the start (when it's just very small subsequences) to merge while quick sort can multitask at the end (because things have been partitioned) How would they compare in best, random, and worst case permutations?
@toddkes5890
@toddkes5890 2 жыл бұрын
Merge would likely do better as Quicksort relies a little upon luck to find a good split for the smaller lists. Smarter Quicksorts will often pass the lowest and highest values of a list, so the recursive call can identify the average between the two values and try to use that to split the list properly. This even splitting doesn't work right if the values are 'clustered' (i.e. a list with two numbers that are less than 100, eighteen numbers that are in 100-200 range, and five numbers that are in the 201-5000 range). Radix (MSD) could also benefit from multi-tasking, as each sub-group is then put into its own task for sorting.
@vicktorioalhakim3666
@vicktorioalhakim3666 10 жыл бұрын
I'd favor using merge sort over quick sort, simply because of the deterministic behavior. In one of my projects, I use sorting in a real-time system. Ensuring deterministic behavior is essential for estimating the performance and execution times of tasks.
@ferociousfeind8538
@ferociousfeind8538 2 жыл бұрын
A bit late, but if you need deterministic behavior out of quick sort, have it pick the first element of an unsorted list. Or the last. The method of selecting the pivot is not important to it guaranteeing a sorted list at the end, but it may be paramount for sorting very quickly. Remember, if quicksort gets lucky and evenly divides the list in half with every pivot, it gets really really good results (not sure how good though), while its worst performance is roughly on par with insertion sort (picking the an element from an unsorted list that goes either at the top or at the bottom of the sorted list, i.e. never splitting the list and only reducing its size by 1 every pass)
@Carlos-ux7gv
@Carlos-ux7gv Жыл бұрын
Merge sort is guaranteed to be O (n log n) and is a stable sort, while Quick Sort is O(n²) in the worst case.
@halfnwhole751
@halfnwhole751 6 жыл бұрын
2:18 Top 10 Anime Battles
@bebel9349
@bebel9349 5 жыл бұрын
Underrated
@bayram00
@bayram00 3 жыл бұрын
LMFAO
@jamieyang6416
@jamieyang6416 4 жыл бұрын
This is my FAVORITE out of the search algorithm visualization videos...... the sound of the balls being placed back down is so satisfying I come back at least once a year to listen to the sound and watch the intense sorting match lol
@JTX8000
@JTX8000 8 жыл бұрын
instead of hoping for miracle, it indirectly implies to bogo
@MiguelX413
@MiguelX413 7 жыл бұрын
JTX8000 xd
@Fif0l
@Fif0l 4 жыл бұрын
Bongo*
@AeroTheVaporeon
@AeroTheVaporeon 4 жыл бұрын
@@Fif0l bogo sort actually. OH YOU LIKE SORTING? NAME EVERY *_S O R T_*
@anhbui-bc4ew
@anhbui-bc4ew 3 жыл бұрын
@@AeroTheVaporeon cheeseburger sort
@OneDirection267
@OneDirection267 4 жыл бұрын
I’m so glad I found this channel. Makes me fall in love with Programming all over again when I’m losing hope
@ricj9594
@ricj9594 4 жыл бұрын
Same
@ArixZajicek
@ArixZajicek 8 жыл бұрын
Anyone notice that the blip noise sounds exactly like Starbound's activate computer noise?
@xianchen1935
@xianchen1935 5 жыл бұрын
Omg you're right haha xD
@mozarteanchaos
@mozarteanchaos 3 жыл бұрын
maybe it's a stock sound effect? either way, pretty interesting.
@nathancollins1715
@nathancollins1715 3 жыл бұрын
Pretty sure they use it in the Talos Principle too.
@japanpanda2179
@japanpanda2179 3 жыл бұрын
If quicksort chooses, by random, the highest-value unsorted item in the list each time then it literally becomes bubble sort. If it randomly chooses the highest and lowest alternately, it becomes cocktail sort.
@barbarabeltran8274
@barbarabeltran8274 5 жыл бұрын
Merge all the way Sees 1st round: NOOOOOOOOOOOOOOOOOOOOOO!!!!!!!!!!!!!!! Sees 2nd round: YEA BOIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII
@guy7329
@guy7329 4 жыл бұрын
And now say hello to MULTITHREADING
@chauchau0825
@chauchau0825 5 жыл бұрын
This is by far best way of teaching algorithm I have ever seen in my entire life
@SanctuaryReintegrate
@SanctuaryReintegrate 5 жыл бұрын
I wanna witness the robot for Radix LSD In-place Sort (Base 10)
@huyphamuc6372
@huyphamuc6372 5 жыл бұрын
You kidding? Radix sort isn't based on comparisions, how do you supposed those robots to do?
@fuitbythefoot
@fuitbythefoot 4 жыл бұрын
@@huyphamuc6372 swish em around blindly
@smaybius
@smaybius 3 жыл бұрын
The screen at the front of the table should show which number each ball is, and the robot should make piles for each digit it focuses on, then dumps them back into the list in order. It starts from the last digit, and the process repeats as it works its way up
@aledagrosa9027
@aledagrosa9027 Жыл бұрын
I'm new to programming and had problems understanding merge-sorting, how does it work and why it's efficient. Thanks to this video I answered every question in less than 5 minutes Thank you, short sighted robots!
@3ds12Game
@3ds12Game 10 жыл бұрын
MORE! Dude! we love this, come on! You know, when you start a channel with "GOOD" videos. then you have to go on!
@nadie-qm8rq
@nadie-qm8rq 2 жыл бұрын
No matter how many of these videos I watch, I still think these competitions are so funny, like is serious stuff
@sasdagreat8052
@sasdagreat8052 6 жыл бұрын
I've been trying to understand the merge sort for a few weeks now, but to no avail. Who knew a robot with bowling balls was what I needed to finally get the concept?
@wChris_
@wChris_ 2 жыл бұрын
Merge sort can actually alternate the shelf its using to optimize moving the elements (in addition to the optimization listen in the article). How much would that increase Merge Sort by? Actually Merge sort can choose to in-place Merge the first 2 Elements based upon if it would need to move the elements on the last merge again, which would only happen if there is an odd number of recursion steps.
@hastley64
@hastley64 5 жыл бұрын
i wish my teacher explained like this... this video is GOLD!
@ArberKryemadhi
@ArberKryemadhi Жыл бұрын
Put this series on the tv and boys will cheering on their favorite robots. Fights will be started over wrong predictions.
@김준섭_7769
@김준섭_7769 9 жыл бұрын
wow.. i could understand sorting algorithms easily. thank you!!
@ginhoney
@ginhoney 5 жыл бұрын
I was on the verge of having a breakdown before watching this video (my exam is in 2 days and i still have to cram an entire semester worth of work and i don't understand shit). Thank you for this fun way of explaining this!
@themachoyoshi
@themachoyoshi 5 жыл бұрын
On this week’s episode of “Why Is This In My Recommended”
@antoinettenaughton6382
@antoinettenaughton6382 4 жыл бұрын
I think this is an awesome visual representation of sorting. How many screeching line sorts can one watch?
@Iknowrealtv
@Iknowrealtv 9 жыл бұрын
You saved my life why couldn't you be my teacher.
@wishmaker7863
@wishmaker7863 7 жыл бұрын
but...isn't that kind of difficult for public school?
@Ucefgrb
@Ucefgrb 5 жыл бұрын
@@wishmaker7863 is that supposed to be a roast ? Cuz I'm not really sure
@wishmaker7863
@wishmaker7863 5 жыл бұрын
@@Ucefgrb there must have been a longer comment chain that's since been deleted...i honestly don't remember what i meant when writing this.
@Chlocean
@Chlocean Жыл бұрын
I can't process math this quickly, nor does this really mean anything to me pertaining to actual computing, but I'm on the spectrum and this is like the perfect li'l sensory video for my brain.
@rob4290
@rob4290 4 жыл бұрын
That merge sort robot was definitely concerned when the balls started sorting themselves.
@popop72276
@popop72276 3 жыл бұрын
i love this, i could watch this all day
@juanverhook1608
@juanverhook1608 8 жыл бұрын
Quicksort is much faster in practice, and it is not only because memory consumption is lower but also because by using randomized algorithms you can choose an optimal pivot.
@smaybius
@smaybius 2 жыл бұрын
Regular quicksort is O(n^2) worst case probably regardless of pivot choice. Randomized pivots make it a probably 1 in O(n) chance of it being the worst case. Try finding a good pivot for inputs that involve both halves or each quarter being already sorted and also perfectly linear instead of wrinkly. You're also right in some ways about it being faster in practice, as standard programming languages use it or variants as their default sort and merge sort or variants as their default stable sort. Some like Python only use merge sort or variants. Some variants of quicksort like introsort (default sort of C++ and C#) alleviate the worst case by using heap sort, or Java (at least OpenJDK) uses a dual-pivot quicksort. Partitions can be done by medians or something instead of particular items. There's a small but talented and active group by Musicombo that's dedicated to making sorting algorithms, either for fun or as serious and fast algorithms
@extrapathos
@extrapathos 5 ай бұрын
Merge sort is definitely my favorite now, I like the way it thinks
@giruppy
@giruppy 9 жыл бұрын
Can quick sort be adjusted to shoot for the average pivot? Say it surveys the data it has, finds the min and max, and averages that out and then uses the closest value for its first pivot? I'm sure this has already been thought up long ago - if so, what's it called?
@udiprod
@udiprod 9 жыл бұрын
giruppy Yes, there are all kinds of variants of this type. You can see here: en.wikipedia.org/wiki/Quicksort#Choice_of_pivot Actually finding the min and max as you suggest might work, but it will be more costly. An even more costly solution is to actually find the median, which is the optimal choice. There's an efficient way to do it in O(n) time, which yields a quicksort with guaranteed O(nlogn) runtime. But in practice (for reasonably sized n) it works much slower. See here en.wikipedia.org/wiki/Median_of_medians
@kumarnkvc
@kumarnkvc 9 ай бұрын
I cant believe KZbin didn't recommend this to me for TEN YEARS!!!.
@wolf0s617
@wolf0s617 7 жыл бұрын
I never thought learning could be this interesting
@saltypretzels290
@saltypretzels290 3 жыл бұрын
May we get a new type of sort like a base 10? Sort?
@hangchen6131
@hangchen6131 7 жыл бұрын
I love those robots. I hope they can accompany me to my exams.
@TheTonyMcD
@TheTonyMcD 4 жыл бұрын
2:25 Wait, if the robots are THAT short sighted, how did did they see when the "countdown" text and had changed reached "sort"?
@TheTonyMcD
@TheTonyMcD 4 жыл бұрын
Upon further examination, I have concluded they must have used the audio cue. They just appeared to both be looking at the same countdown for some conspicuous reason...
@ajsim
@ajsim 7 жыл бұрын
Really well done. I love the animations! Thank you
@thegeneralissimo470
@thegeneralissimo470 6 жыл бұрын
Finally, something that helps you understand what actually goes on
@fabts4
@fabts4 8 жыл бұрын
What if you use Quick Sort for the first level and Merge Sort for the others?
@udiprod
@udiprod 8 жыл бұрын
+fabts4 This will create hybrid algorithm whose statistics are somewhere in between that of quick sort and merge sort (e.g., somewhat more comparisons than merge sort, but a little less than quick sort). Usually quick sort is combined that way with another algorithm: insertion sort, since it performs less swaps.
@fabts4
@fabts4 8 жыл бұрын
+udiprod Haven't seen insertion sort on the chanel...
@udiprod
@udiprod 8 жыл бұрын
+fabts4 Yes, right. I actually plan to do it sometime. Hopefully this year.
@JM-us3fr
@JM-us3fr 6 жыл бұрын
There's probably a linear time algorithm that can determine if Merge or Quicksort is better.
@Ralphgo16
@Ralphgo16 8 жыл бұрын
What if the list was already completely sorted, how would that comparison be?
@aaroldaaroldson708
@aaroldaaroldson708 8 жыл бұрын
Is it me or these robots are so cute?
@vivivizion
@vivivizion 5 жыл бұрын
watching this videos with no sound makes them into surreal mysteries
@ItsJJOLO
@ItsJJOLO 5 жыл бұрын
O god
@BlastinRope
@BlastinRope 4 жыл бұрын
I show these to my dog hes learning how to write javascript
@Ascyt
@Ascyt 4 жыл бұрын
Hey! I know, the video is 5 years old, but can you please make the double selection sort? I've watched some sorting algorithm videos, and somehow the double selection sort was the quickest of them all.
@PL9050
@PL9050 5 жыл бұрын
12:30 am and this stuff is exciting...
@blitzbigboi7613
@blitzbigboi7613 4 жыл бұрын
It's even more exciting at 1:54am
@nitricacid2516
@nitricacid2516 7 ай бұрын
Finally, two with opponents. Their battle will be legendary!
@retpolanne
@retpolanne 5 жыл бұрын
Where were you when I failed my Data Structures and Algorithms exam?
@ravelterthetraveler
@ravelterthetraveler 3 жыл бұрын
Probably programming the robots.
@vineetverma6645
@vineetverma6645 4 жыл бұрын
Hey what sports u watch? "Its complicated"
@michka841
@michka841 5 жыл бұрын
Top 10 epic anime battles
@waltermuzazaila3958
@waltermuzazaila3958 9 жыл бұрын
Great video. Thank you. Do you mind if I ask how did you get this animation ? Thanks. Once again
@udiprod
@udiprod 9 жыл бұрын
Walter Muzazaila Sure, thanks. I created this animation using a tool called Maya.
@ayeariola
@ayeariola 7 жыл бұрын
How about radix sort and bucket sort?
@oinkymomo
@oinkymomo Жыл бұрын
the reason that merge does so much better than quick in the worst-case test is that in quicksort, every element has to be compared against almost every other element (in true worst-case, it would be every element compared against every other). in merge, however, even with the maximum number of comparisons per level (where all the lists of 1 are merged before any of the lists of 2), the number of comparisons is never more than the number of elements, but the number of levels only grows logarithmically (that is, the number of levels increases by 1 with each power of 2 elements you pass)
@sawyannaung3885
@sawyannaung3885 10 жыл бұрын
It is very helpful for me to visualize them. I hope you could do the same for other algorithms as well. Two thumbs up !! (4 if you want to count toes XD)
@frogdaddystar9694
@frogdaddystar9694 4 жыл бұрын
You know you're life is failing when you're cheering on a sorting robot
@aliathif7778
@aliathif7778 5 жыл бұрын
I dont know what is happening but i kinda like it
@SUPABROS
@SUPABROS 7 ай бұрын
3:41 Why doesn't quick sort just pick the middle one on eachi.e a version of binary search adapted to sorting
@udiprod
@udiprod 7 ай бұрын
Assuming the input is random, it doesn't help to pick the middle one. Consider for example the input 3,5,1,2,4. The middle element 1 is not a good pivot. The best pivot is 3, which happens to be first in this example. See a discussion here about different options for choosing the pivot: en.wikipedia.org/wiki/Quicksort#Choice_of_pivot
@digtzydogmemechannel5670
@digtzydogmemechannel5670 6 жыл бұрын
I love the subtle accent of the narrator. There's some accent that she was trained out of but I really want to hear it more...
@aadenboy
@aadenboy 2 жыл бұрын
Hello udiprod! I don't know if you will see this, but I have a question. How would you calculate the start and ending positions of each sublist? I can't seem to wrap my head around it...
@paulblart7378
@paulblart7378 Жыл бұрын
i don't understand. Just divide the length of the list by 2
@aadenboy
@aadenboy Жыл бұрын
@@paulblart7378 this is a year old comment
@DebabrataAcharya93
@DebabrataAcharya93 5 жыл бұрын
0:36 “... and remove the darker one”. r/HolUp
@Alex-gm6gm
@Alex-gm6gm 5 жыл бұрын
Does anyone know what engine the visualization/graphics were made in?
@udiprod
@udiprod 5 жыл бұрын
It was made with Maya
@ZtereoHYPE
@ZtereoHYPE 5 жыл бұрын
This is actually cool
@robschannel1156
@robschannel1156 Ай бұрын
Not what I had in mind when I searched for “merge sort vs quick sort” but still helpful.
@ritik84629
@ritik84629 5 жыл бұрын
I didn't know that I was starving till I tasted you
@microwavedkoolaid9193
@microwavedkoolaid9193 4 жыл бұрын
no
@masterpaletteproductions
@masterpaletteproductions 3 жыл бұрын
Just now I want to see the difference between iterative merge sort and this one which is recursive. Iterative means all the sequence of the size is done at a time before going down
@lapidations
@lapidations 6 жыл бұрын
Phew, for a second I thought that merge would win! #teamquick Edit: oh no, I celebrated too early
@AJ.VIDEOS
@AJ.VIDEOS 4 жыл бұрын
Why is the robot near-sighted? We need to know!
@michawhite7613
@michawhite7613 2 жыл бұрын
It takes time to retrieve the numbers out of memory for the CPU to use.
@Geoxor
@Geoxor 10 жыл бұрын
Im your 3000th SUB :DDDDDD
@udiprod
@udiprod 10 жыл бұрын
Thanks! :)
@vintprox
@vintprox 2 жыл бұрын
I would love to see these as a kid! So fancy.
@alwinpriven2400
@alwinpriven2400 7 жыл бұрын
guys I think I found a way to make the sorts much faster: fix your robot's short-sightness.
@taureon_
@taureon_ 6 жыл бұрын
lmao
@thehiddenninja3428
@thehiddenninja3428 5 жыл бұрын
And what would you do then? Look at them all, and put the darkest at the front, and repeat? Selection sort.
@groszak1
@groszak1 5 жыл бұрын
@@thehiddenninja3428 with fixed short-sightness that would be parallel selection sort
@tomq6491
@tomq6491 2 ай бұрын
Nice video, but can't merge sort be done in place ? If so it wouldn't need the ledge.
@daltonmcghghy9215
@daltonmcghghy9215 5 жыл бұрын
Nobody: KZbin recommended at 12am:
@nicolasturek7563
@nicolasturek7563 Жыл бұрын
why it's picking pivot randomly? isn't it better to take pivot from the middle?
@udiprod
@udiprod Жыл бұрын
If the elements are randomly shuffled, then picking the middle element is the same as randomly picking one. If they're not randomly shuffled, then different strategies for picking a pivot has different implications. You can see a discussion here: en.wikipedia.org/wiki/Quicksort#Choice_of_pivot
@ophello
@ophello 8 жыл бұрын
You talk like asian reporter Tricia Takanawa.
@ItsRawrTopia
@ItsRawrTopia 6 жыл бұрын
family guy lol
@JiancongXie
@JiancongXie 2 жыл бұрын
Really nice explanation, never seen more vivid one.
@qingqiong
@qingqiong 2 жыл бұрын
I didn't care about sort algorithms. I stayed here to watch those cute robots.
@vclarke4433
@vclarke4433 7 жыл бұрын
I love that instant replay on the sorting robots
@amirhosseinahmadi3706
@amirhosseinahmadi3706 4 жыл бұрын
What a fantastic video, absolutely top-notch, thank you so much!
@Oxideacid
@Oxideacid 4 жыл бұрын
Thanks! Now my friends are gonna call me a wizard when I sort a deck of cards in half a second.
@Nathouuuutheone
@Nathouuuutheone 5 жыл бұрын
The "click here" link doesn't work on mobile. Maybe put it in the description box?
@udiprod
@udiprod 5 жыл бұрын
Thanks! Fixed.
@jakeymortlock
@jakeymortlock 7 жыл бұрын
Wouldnt quick sort be better if it always chose the middle?
Heaps and Heap Sort
6:06
udiprod
Рет қаралды 566 М.
Visualization of Radix sort
7:02
udiprod
Рет қаралды 71 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
“Don’t stop the chances.”
00:44
ISSEI / いっせい
Рет қаралды 62 МЛН
Proof That Computers Can't Do Everything (The Halting Problem)
7:52
Insertion Sort vs Bubble Sort + Some analysis
5:17
udiprod
Рет қаралды 329 М.
[Laser] Firing squad synchronization problem
8:47
udiprod
Рет қаралды 1 МЛН
Visualizing 70 Sorting Algorithms
29:24
Kuvina Saydaki
Рет қаралды 222 М.
10 FORBIDDEN Sorting Algorithms
9:41
Ardens
Рет қаралды 947 М.
I Made Sorting Algorithms Race Each Other
8:24
Green Code
Рет қаралды 243 М.
Slow sorting: Stooge sort and Bogo sort
40:53
udiprod
Рет қаралды 470 М.
Quicksort: Partitioning an array
4:48
KC Ang
Рет қаралды 596 М.
Visualization of Quantum Physics (Quantum Mechanics)
14:34
udiprod
Рет қаралды 2,7 МЛН
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН