50+ Sorts, Visualized - Reversed Inputs

  Рет қаралды 220,136

Musicombo

Musicombo

Күн бұрын

Пікірлер: 684
@Musicombo
@Musicombo 3 жыл бұрын
Join our community Discord! discord.com/invite/2xGkKC2
@DerpyNub
@DerpyNub 3 жыл бұрын
Rip no likes :(
@bryceg1020
@bryceg1020 4 жыл бұрын
Every other sort-uses givin values Gravity sort-yall mind if I just *c h a n g e t h e v a l u e s*
@bendaonfire0078
@bendaonfire0078 4 жыл бұрын
What if i set them all to the same value BOOM Sort skill 100
@tiporial
@tiporial 4 жыл бұрын
pizza mozzarella pizza mozzarella rella rella rella rella
@soulsilversnorlax1336
@soulsilversnorlax1336 4 жыл бұрын
@@tiporial this comment could be a big hit in Europe
@LabyrinthFunkinDev
@LabyrinthFunkinDev 6 ай бұрын
Everyone else: “Keep with the values.” Gravity Sort: “My name may have Gravity in it, but I defy *_a n y t h i n g I w a n t .”_*
@Apfelbaum454
@Apfelbaum454 5 жыл бұрын
You: Gnome Sort The Guy she tells you not to worry about: Optimized Gnome Sort
@diceLibrarian
@diceLibrarian 4 жыл бұрын
You've just been G'Nome Sorted
@thisrecordingsessiontm3633
@thisrecordingsessiontm3633 4 жыл бұрын
Her father: Odd-Even Sort
@Dinosaurs_with_laser_guns
@Dinosaurs_with_laser_guns 4 жыл бұрын
Lol 😹
@MrCubFan415
@MrCubFan415 4 жыл бұрын
(insert keemstar joke here)
@AtariWow
@AtariWow 4 жыл бұрын
Max Heap Sort
@roshambo4137
@roshambo4137 5 жыл бұрын
"Yo pass me the aux cord" "You better not play trash" *plays the In-Place Radix LSD Base 16 Sorting of reversed inputs with 2,048 numbers*
@alluseri
@alluseri 5 жыл бұрын
timecode ples
@alluseri
@alluseri 5 жыл бұрын
Timecode: 11:10
@GoldenGamerFox7272fromYT
@GoldenGamerFox7272fromYT 5 жыл бұрын
timestamp*
@lilmarionscorner
@lilmarionscorner 5 жыл бұрын
Alluseri timestamp: 11:10
@souplover6845
@souplover6845 4 жыл бұрын
My jam
@kunyoruyo
@kunyoruyo 5 жыл бұрын
18:20 "ok let me fix that... wait... no... what's going on??"
@estergallardo3594
@estergallardo3594 5 жыл бұрын
This comment is not cool 😻💪👎🤙👎😽💪👎😻👎🙀👎😼🤞🎃👺👹
@michaleatsonionsforbreakfast
@michaleatsonionsforbreakfast 4 жыл бұрын
Ixpantenco it's pancake sort
@hollyleaf3941
@hollyleaf3941 4 жыл бұрын
@@estergallardo3594 And you're cool I suppose?
@Pallid3
@Pallid3 4 жыл бұрын
It's just robot
@dragonsdream4236
@dragonsdream4236 4 жыл бұрын
@@spedur3361 found the thirteen year old
@superscatboy
@superscatboy 4 жыл бұрын
Programmers in theory: look at all these options we have for sorting in different situations Programmers in practice: std::sort
@lychy645
@lychy645 4 жыл бұрын
superscatboy truu
@benjaminschaaf
@benjaminschaaf 4 жыл бұрын
Pigeonhole sort requires a limited range of integers (or equivalent). Using pigeonhole to sort a list containing just the numbers 1 and 1 trillion (1000000000000) requires 8TB of storage for example. It's great when you have a large set of integers in a small range, but that's almost never the case in practice.
@bathbombman
@bathbombman 4 жыл бұрын
quicksort when
@somenamelastnaammee52
@somenamelastnaammee52 4 жыл бұрын
_Arrays.sort();_
@firstnameiskowitz8493
@firstnameiskowitz8493 4 жыл бұрын
16:27 when you have five minutes left to finish all the questions in your exam
@CJBox9
@CJBox9 2 жыл бұрын
lmao that actually made me nose laugh
@victorfunnyman
@victorfunnyman 2 жыл бұрын
nose expiration ye lmao, it got quick so weirdly
@JetFalcon710
@JetFalcon710 6 ай бұрын
"Alright screw this. YEET" -Weave Merge Sort 2019
@nejitentenlee21
@nejitentenlee21 5 жыл бұрын
I finally understand how gravity sort works! It doesn’t sort by moving, it changes the value of the item in each place until it’s the right value for that place
@Musicombo
@Musicombo 5 жыл бұрын
Yup! Uses a lot of scratch space in memory to do all that subtracting/adding, as well.
@jacobw1780
@jacobw1780 5 жыл бұрын
What is min heap sort then?!
@devinandcarrietotaldrama505
@devinandcarrietotaldrama505 5 жыл бұрын
@@Musicombo how about counting sort?
@RubyPiec
@RubyPiec 4 жыл бұрын
Can you give an example using numbers?
@uzairm3816
@uzairm3816 4 жыл бұрын
@@mrninjagon270 @chacha charlie well technically you can consider non descrete values to be discrete, but there is only 1 of each value. It would be really inefficient, not impissible for the counting sort
@caseyashworth8016
@caseyashworth8016 5 жыл бұрын
Smooth sort: is called smooth sort Also smooth sort: 5:24
@yonka-cola8792
@yonka-cola8792 4 жыл бұрын
Spiky
@louispipercarson9630
@louispipercarson9630 4 жыл бұрын
pointy sort
@givrally
@givrally 4 жыл бұрын
I was just about to say that ! It's literally the least smooth of all, maybe excluding heap sort variants.
@brayden205
@brayden205 4 жыл бұрын
Casey Ashworth I think it’s called smooth sort due to how quick and clean the sort itself is
@raybeetle
@raybeetle 4 жыл бұрын
Ru²Kanga clean?
@wow-uf9ke
@wow-uf9ke 5 жыл бұрын
pancake sort be like bruh
@dannadx3840
@dannadx3840 5 жыл бұрын
Man, not all sorting algorithms are designed to work with purely this type of data. Probably it was developed for something very specific
@dannadx3840
@dannadx3840 5 жыл бұрын
Yeah, it certainly is. I got time and checked. The only available operation is element flipping, so it just wasn't designed to work in this data type
@jr01theweeb
@jr01theweeb 5 жыл бұрын
18:20 The sort took 3 minutes
@-1f
@-1f 5 жыл бұрын
my mans be like bruh
@ilikeceral3
@ilikeceral3 4 жыл бұрын
dannad x what the heck is pancake sort for then?
@ThomasBomb45
@ThomasBomb45 3 жыл бұрын
2:12 looks like a rotating 3D image. Nice
@draganahajdin404
@draganahajdin404 2 жыл бұрын
It does!
@err0rcube115
@err0rcube115 2 жыл бұрын
Omg it does lol
@victorfunnyman
@victorfunnyman 2 жыл бұрын
true tho
@JetFalcon710
@JetFalcon710 Жыл бұрын
Yeah, it's like watching someone rotating an empty box
@sawyermerkle8835
@sawyermerkle8835 4 жыл бұрын
4:43 And here, you see a sorting algorithm sorting a reversed input to another reversed input...
@EJayy13
@EJayy13 2 жыл бұрын
Min heap sort is just wrong.
@edwardclark6731
@edwardclark6731 2 жыл бұрын
4:49 SIKE
@EJayy13
@EJayy13 2 жыл бұрын
@@edwardclark6731 no
@Tekkwin
@Tekkwin 5 жыл бұрын
is this how they made earthbound sounds
@Musicombo
@Musicombo 5 жыл бұрын
Hahaha :P
@jacobw1780
@jacobw1780 4 жыл бұрын
No.
@Pedro270707
@Pedro270707 4 жыл бұрын
@@jacobw1780 r/woooosh
@jacobw1780
@jacobw1780 4 жыл бұрын
@@Pedro270707 O H N O
@trashmann1081
@trashmann1081 4 жыл бұрын
pk algorithm
@demonschnauzer1555
@demonschnauzer1555 4 жыл бұрын
17:21 Introsort: Well, I just completed my task, better celebrate!
@mamf6175
@mamf6175 5 жыл бұрын
Set Playback Speed to 2 to improve the algorithms
@dirtydan9785
@dirtydan9785 4 жыл бұрын
big brain moment
@EJayy13
@EJayy13 2 жыл бұрын
Or 720p60
@maurolionelmisjuegosyo940
@maurolionelmisjuegosyo940 2 жыл бұрын
No
@LunarLambda
@LunarLambda 5 жыл бұрын
poor pancake sort
@jacobw1780
@jacobw1780 4 жыл бұрын
18:22
@amethystt727
@amethystt727 4 жыл бұрын
It tried, but it just wasn't enough
@uklu
@uklu 4 жыл бұрын
Still faster than bubble sort
@panze-r
@panze-r 2 жыл бұрын
It's a joke sort so its born to be trash unfortunately
@StormTheSquid
@StormTheSquid 2 жыл бұрын
It's just showing off.
@glitchy9613
@glitchy9613 4 жыл бұрын
26:34 So we've made the pattern just the reversed version of what the order is supposed to be, so its easier for you to sort them. Less Bogo Sort: Ok...
@JiMMy-xd8nu
@JiMMy-xd8nu 4 жыл бұрын
omg yes
@ojd9145
@ojd9145 2 жыл бұрын
Yeah
@Coolmanerik_Z
@Coolmanerik_Z 2 жыл бұрын
relatable
@dr.jacksonbright5723
@dr.jacksonbright5723 3 жыл бұрын
Imagine using silly sort on a comically small set, thinking “maybe it’s silly’s time to shine,” only for your computer to freeze for seventeen and a half seconds before presenting a sorted set
@californium-2526
@californium-2526 3 жыл бұрын
A set of 256: 17,5s A set of 2048: 1m41,6s or something
@Musicombo
@Musicombo 3 жыл бұрын
It doesn't work like that; it's not linear complexity. 2,048 items would probably take over a day.
@californium-2526
@californium-2526 3 жыл бұрын
@@Musicombo Ah, the beauty of O(n^(log n)) (didn't know that it was that bad while I was making that comment)
@BigFatWedge
@BigFatWedge Жыл бұрын
Silly Sort took 572 MILLION COMPARISONS to sort 256 items!! XD
@pencrows
@pencrows 4 жыл бұрын
Patience Sort: get your popcorn and take a seat, we're gonna be here a while Also Patience Sort: 2 seconds
@edwardclark6731
@edwardclark6731 2 жыл бұрын
thats terribly inefficient if it was real time
@colouur4778
@colouur4778 4 жыл бұрын
9:57 wait that’s illegal
@EXA1024_
@EXA1024_ 4 жыл бұрын
ikr
@maxhaibara8828
@maxhaibara8828 4 жыл бұрын
Bogo Sort can be the fastest sorting algorithm, with the chance of happening of 1/n!
@DragoStar
@DragoStar 4 жыл бұрын
I may be late but is that 1 over n factorial or is it an excited 1 over n ?
@MineSomeCraftPoo
@MineSomeCraftPoo 4 жыл бұрын
@@DragoStar this is probably a joke, but hey, anyway it's n! since thats the total number of ways to order n elements
@almogz9486
@almogz9486 4 жыл бұрын
@@DragoStar 1 over n factorial
@asheep7797
@asheep7797 2 жыл бұрын
@@DragoStar 1 over nfactorial
@LindenF
@LindenF 5 жыл бұрын
5:25 I’m sure that is not smooth it looks sharp
@screamsinrussian5773
@screamsinrussian5773 4 жыл бұрын
no
@brayden205
@brayden205 4 жыл бұрын
I’m pretty sure it’s called that due to the sporting not being sloppy or confusing as others
@edwardclark6731
@edwardclark6731 2 жыл бұрын
smooth heaps: *am i a joke to you?*
@edwardclark6731
@edwardclark6731 2 жыл бұрын
Future me: *Yes. Yes you are.*
@icebearpl188
@icebearpl188 5 жыл бұрын
When bad sort gets to be one of the fastests
@jacobw1780
@jacobw1780 4 жыл бұрын
Good sort
@katalysator3431
@katalysator3431 4 жыл бұрын
well it doesnt use as much numbers so...
@Digephil
@Digephil 4 жыл бұрын
2:50 my guinea pigs when I'm cutting bell peppers.
@Zyn_Shi
@Zyn_Shi 4 жыл бұрын
I’m glad someone had the same idea!
@ojd9145
@ojd9145 Ай бұрын
yeah
@fachriem
@fachriem 4 жыл бұрын
i really love 10:36 so much! easy algorithm and yet best performance~
@californium-2526
@californium-2526 3 жыл бұрын
Ah yes. 573 microseconds ERT, just behind of TimSort (391 microseconds ERT, 16:32) It's a storage and memory (?) hog though.
@jeremyaster7470
@jeremyaster7470 Жыл бұрын
pigeonhole sort just built different
@entredus7910
@entredus7910 11 ай бұрын
elements 1 and a really, really big number
@Lonely_Wiz
@Lonely_Wiz 4 жыл бұрын
21:34 flight of thr bumblebee
@chimaudeh5159
@chimaudeh5159 4 жыл бұрын
Love how the smooth sort (5:24)is in no way smooth
@bingobeego
@bingobeego Жыл бұрын
LMAO
@JetFalcon710
@JetFalcon710 Жыл бұрын
Smooth sort actually roughened up the surface of the triangle
@diamboy
@diamboy 5 жыл бұрын
Base 16 looks like it’s trying to say something
@pittagiiya
@pittagiiya 5 жыл бұрын
Sounds like it's trying to say something; not sure whether that's what you meant to say or just what I think
@jonasferraz
@jonasferraz 5 жыл бұрын
11:11
@MrtinVarela
@MrtinVarela 5 жыл бұрын
Batcher's bitonic: *"yes, but actually... no"*
@mateuszodrzywoek8658
@mateuszodrzywoek8658 4 жыл бұрын
it does make some pretty fire beats if i say so myself
@NXTangl
@NXTangl Жыл бұрын
That's just what happens when you're literally the opposite of adaptive!
@jyosongurung5583
@jyosongurung5583 Жыл бұрын
That’s at 12:58
@jyosongurung5583
@jyosongurung5583 Жыл бұрын
Also what the $%#&?????
@Fireball7428
@Fireball7428 Жыл бұрын
And then there's Pancake sort at 18:20.
@aether-music
@aether-music 4 жыл бұрын
16:24 "Nope, I'm done"
@ZA-mb5di
@ZA-mb5di 4 жыл бұрын
17:21 sounded like All Star for a second
@fridaykitty
@fridaykitty 4 жыл бұрын
nice 69th like
@pannesterpants3008
@pannesterpants3008 4 жыл бұрын
Omg ur right
@galimantis
@galimantis 4 жыл бұрын
10:29 _What._
@twoarrow9134
@twoarrow9134 4 жыл бұрын
“yeet”
@thatcrystalpie
@thatcrystalpie 4 жыл бұрын
The algorithms have learned to count
@lillie3029
@lillie3029 4 жыл бұрын
Galimantis 10:37 *
@wenirlicker6808
@wenirlicker6808 4 жыл бұрын
Count Count Sort
@JNSStudios
@JNSStudios 4 жыл бұрын
H O W
@sillybeanthing
@sillybeanthing 3 жыл бұрын
I like it when the red line is stuck focusing on one point like it's working super diligently to sort the things in the area, then it goes to another place and starts again
@ninja3212
@ninja3212 4 жыл бұрын
TimSort be like: "Y'all mind if I just flip the array?"
@californium-2526
@californium-2526 3 жыл бұрын
Est. Real Time: 391 microseconds.
@Hjerpower
@Hjerpower 4 жыл бұрын
I like how min heap sort went through the whole heapification process to only end up back where it started
@BigFatWedge
@BigFatWedge Жыл бұрын
See, YOU can see all the items at once , but the algorithm cant. It can only compare two items at a time. To us, it just looked like Min Heap Sort turned a reverse array back into a reversed array. But to Min Heap Sort, it turned an array of didn't know was reversed, to an array it DID know was reversed.
@deffinatalee7699
@deffinatalee7699 4 жыл бұрын
12:58 Batcher needs to make up his mind
@FusionArmorX
@FusionArmorX 4 жыл бұрын
12:27 The sound of 100, 500, and then 1000 point enemies being destroyed.
@TheEgglet
@TheEgglet 4 жыл бұрын
2:17 it looks like a hole in a box lol
@Obviary
@Obviary 5 жыл бұрын
3:02 if you listen closely it almost sounds like megalovania
@attack54
@attack54 4 жыл бұрын
Obviary god damnit take my like
@amogus7
@amogus7 3 жыл бұрын
42th
@quillenkai6714
@quillenkai6714 4 жыл бұрын
I thinks it's absolutely amazing that bogo sort with 8 inputs took nearly 10x as long (estimated) as quicksort with 2048 inputs
@Hasde_dfs
@Hasde_dfs 2 жыл бұрын
And that’s without even talking about pigeonhole sort
@kingsley.
@kingsley. 2 жыл бұрын
@@Hasde_dfs tim sort
@rexperverziff
@rexperverziff Жыл бұрын
@@Hasde_dfstime stamp?
@locrianphantom3547
@locrianphantom3547 Жыл бұрын
Wait til you see BOGOBOGO sort…
@bogdan_ostaficiuc
@bogdan_ostaficiuc Жыл бұрын
​@@locrianphantom3547with 10 inputs!!!!
@Jack-lp3gc
@Jack-lp3gc 5 жыл бұрын
so is no one gonna point out that min heap sort did a bunch of stuff to the inputs only to get right back to where it started and then flip it around
@ATtiny13a-PU
@ATtiny13a-PU 5 жыл бұрын
11:10 - is drop from dubsteb
@taureon_
@taureon_ 4 жыл бұрын
which
@screamsinrussian5773
@screamsinrussian5773 4 жыл бұрын
dubsteb
@EdKolis
@EdKolis 2 жыл бұрын
I like the ones that don't even maintain the integrity of the original data but somehow put it all back at the end, like the gravity sort
@mcbattery856
@mcbattery856 5 жыл бұрын
Where's that comment with the list of sorts?
@busher6004
@busher6004 4 жыл бұрын
Gone Reduced to atoms
@marcosgreg9983
@marcosgreg9983 4 жыл бұрын
Seems not sorted yet
@MishaG4mer
@MishaG4mer 5 жыл бұрын
Counting sort: I am speed Patience sort: You are quick, But im faster
@MishaG4mer
@MishaG4mer 5 жыл бұрын
Time Sort: Hold my beer
@MishaG4mer
@MishaG4mer 5 жыл бұрын
TimSort: Try me bitches
@finniko1995
@finniko1995 5 жыл бұрын
Pigeonhole Sort: Boom, done! What now?
@MishaG4mer
@MishaG4mer 5 жыл бұрын
Pancake sort: YOU DARE OPPOSE ME MORTAL Hold on gotta scan the algorithm 69420 times before confirming its sorted
@ConsarnitTokkori
@ConsarnitTokkori 5 жыл бұрын
pancake sort: merry christmas 2016!
@buurk
@buurk 4 жыл бұрын
11:11
@Memerath
@Memerath 3 жыл бұрын
the time, the sort, the mathematical perfection of it all
@takedLLC
@takedLLC 5 жыл бұрын
Is no one going to mention that at one point gravity sort had all of the numbers the same?
@ironoat
@ironoat 5 жыл бұрын
You should look up gravity sort. It's a really cool concept. You could build a physical system using it to sort in linear time. It is also called bead sort
@Choinkus
@Choinkus 5 жыл бұрын
It's pretty cool but unfortunately it's not very efficient
@dezcubing5844
@dezcubing5844 5 жыл бұрын
I saw from another comment that it changes all the values until its the right value for the place
@cephalosjr.1835
@cephalosjr.1835 4 жыл бұрын
Choinkus Gravity sort is only good on specialized hardware. Of course, if you implement it on hardware, it’s very fast.
@takedLLC
@takedLLC 4 жыл бұрын
@@ironoat I know
@bigloudnoise
@bigloudnoise 2 жыл бұрын
I'm surprised Pancake Sort didn't see the obvious solution of just flipping the entire stack once to get it in the correct order. I presume there's a limitation to the algorithm (which I am unfamiliar with) that forces it to start inside the stack, thus preventing it from just flipping the whole thing in one shot.
@BigFatWedge
@BigFatWedge Жыл бұрын
Pancake Sort searches for the largest item in the remaining list, and then reverses the part of the list ranging from the first item in the list to the largest item. For example, if the largest item is the 50th item, reverse the order of the first 50 items. This puts the largest item(in the remaining list) at the front of the remaining list. Then you reverse the ENTIRE remaining list, putting the largest item in the last position in the remaining list. Then redesignate the last(largest) item as part of the sorted list. Then do it again on the remaining list, until it reaches a length of 1 item. It's basically Selection Sort, but made much worse for no reason. So, in this case, on the first iteration, it finds the largest item(already the first, as the list is in descending order), then reverses the list from the first item to the largest item(since this is a list of 1 item, nothing happens), then reverses the entire list, which sorts it. But the algorithm doesn't check if the list is sorted, it just searches for the largest item in the remaining list. Because it reversed the entire array, putting it in ascending order, the largest element in the remaining list is at the end, making the algorithm reverse the entire list to put the largest item at the beginning, then reverse it AGAIN to put it at the end and thus sort it. But it isn't checking, every time it reverses the array, if it's sorted. In short: although it sorts the list in "one shot," it doesn't KNOW if did that, cause it didn't check. Hope that answers your question.
@SKyrim190
@SKyrim190 4 жыл бұрын
Some of those look to me like (1) read the list (2) print the sorted list is the whole algorithm. I can not even begin to guess what is going on. Also, silly sort looks like a merge sort that got neurotic and is afraid the list might change when he is not looking
@ThomasBomb45
@ThomasBomb45 3 жыл бұрын
They use auxiliary data structures. The visualization really should show them
@FunctionGermany
@FunctionGermany 5 жыл бұрын
Batchers Bitonic Sound be like: "now i know this might look like the exact same thing but just hold on for a bit"
@niku4154
@niku4154 4 жыл бұрын
Nobody: Old PCs when you put in a CD: 18:13
@wladfan
@wladfan 3 жыл бұрын
Whoops! You have to put the CD in your computer
@Guinea.Pig-Gaming
@Guinea.Pig-Gaming 5 жыл бұрын
odd-even sort looks like a 3d structure changing shape.
@DogeisCut
@DogeisCut 4 жыл бұрын
It does tho
@sameendusk2623
@sameendusk2623 5 жыл бұрын
16:32 timsort's not having any of this reverse bullshit
@Caseofgames
@Caseofgames 4 жыл бұрын
9:57 Perfectly balanced, as all things should be.
@thatonecountryballanimator
@thatonecountryballanimator 2 жыл бұрын
9:58
@Caseofgames
@Caseofgames 2 жыл бұрын
@@thatonecountryballanimator It's already unbalanced at 9:58.
@thatonecountryballanimator
@thatonecountryballanimator 2 жыл бұрын
Whoops, sorry.
@ilikeceral3
@ilikeceral3 4 жыл бұрын
Why am I watching sorting videos when I don’t even know math
@thatcrystalpie
@thatcrystalpie 4 жыл бұрын
Pigeonhole sort is like "I SEE THROUGH THE LIES OF THE *reversed inputs"*
@notquitebleu
@notquitebleu 4 жыл бұрын
Everyone gangsta til odd-even sort makes the sorting 3D
@Giyga
@Giyga 3 жыл бұрын
I find pancake sort very funny when it starts swapping rapidly towards the end
@MayorVideo
@MayorVideo 4 жыл бұрын
7:52: the best one
@mikaroni_and_cheez
@mikaroni_and_cheez 4 жыл бұрын
Merge sort is kind of how people sort things, you group similars together and then pick out the similarities to those groups and so on until 0 to 100 are lined up
@mistycremo9301
@mistycremo9301 2 жыл бұрын
I wish you would do a bit of color coding for what state the sorts are actually in- say green for "known to be sorted", and maybe separate colors for each layer of heapsort's heap
@RichConnerGMN
@RichConnerGMN Жыл бұрын
nice pfp
@IronBoy-hf2lp
@IronBoy-hf2lp 5 жыл бұрын
@ Pancake Sort: BRUUUUH WHAT ARE YOU DOOOOOOING
@nathanzotov1160
@nathanzotov1160 4 жыл бұрын
batchers bitonic be like: Ok yeah, go there, uh huh, wait stop! Go back, go back. go right there. Yeah. WAIT NO COME BACK HERE!
@relt_
@relt_ 4 жыл бұрын
i love how batcher's odd-even merge sort just *transitions* the values
@AlisterCountel
@AlisterCountel 5 жыл бұрын
This made me curious, is there an algorithmic way to find the specific “worst case scenario” for any given sort? Between this and the already sorted inputs, it certainly seems like there are some non-random arrangements which take excessive amounts of time compared to a normal sort.
@Musicombo
@Musicombo 5 жыл бұрын
It's probably more often that people have just come across worst cases for these sorts, but I'm not sure about an algorithm. I would be curious about that, too!
@erikprantare696
@erikprantare696 5 жыл бұрын
I'll try to prove that there doesn't exist a general algorithm for that, in a similar way that you prove that there is no general way to solve the halting problem: Assume that there is an algorithm A(s, i), that tells you whether an input i is the worst case input for a given sorting algorithm s Construct sorting algorithm S, that given A(S, i), will sort using quicksort if i is the worst case input, and otherwise use bogosort (or any other algorithm that is going to be slower than quicksort) But, this means that for I = worst case input for S, A(S, I) /must/ say that I is not the worst case. Therefore, there exists no general algorithm A that can determine if a given input is the worst case scenario for a given sort. I hope this makes sense :)
@Musicombo
@Musicombo 5 жыл бұрын
@@erikprantare696 That does, thank you so much!!
@slycordinator
@slycordinator 5 жыл бұрын
"Between this and the already sorted inputs, it certainly seems like there are some non-random arrangements which take excessive amounts of time compared to a normal sort." While that seems true, there are exceptions. For instance, insertionsort is faster for "nearly-sorted" and "completely sorted" lists than for ones that have random data. In fact, it's why one method used to speed up something like quicksort is to simply do nothing when partitions are fairly small, then when that whole thing completes, run insertionsort on that mostly-sorted list. edit: What I'm getting at is that the same non-random arrangements don't affect each sort the same way.
@Fera-gr5mm
@Fera-gr5mm 4 жыл бұрын
Brute-force algorithm might go through all n! permutations and measure it manually.
@52.yusrilihsanadinatanegar79
@52.yusrilihsanadinatanegar79 4 жыл бұрын
Batcher's Bitonic Sort "wait, let me merge it in" "oh wait, there is a problem" "ok then, i'll reverse it back to fix that problem" "oh wait, it's the input" "let's merge it all to-" "r e v e r s e a n d m e r g e"
@EchoFaustMusic
@EchoFaustMusic 3 жыл бұрын
I always found it strange why block sort algorithm seem to, for lack of a better word, carry numbers along while sorting.
@Musicombo
@Musicombo 3 жыл бұрын
That's their internal buffer!
@AntonDiaz7
@AntonDiaz7 Жыл бұрын
18:21 Pancake Sort: I can finish it fast but I'd prefer to torture it.
@shoobfloof22
@shoobfloof22 5 жыл бұрын
Time sort: Estimated Real Tome: 8,192 ms That’s only 8.1 seconds, but it feels like eons compared to the rest of the sorts... Edit: never mind. Silly sort and slow sort killed it. Lmao.
@theairaccumulator7144
@theairaccumulator7144 5 жыл бұрын
Yes, because time sort works by waiting in many threads at once.
@jacobw1780
@jacobw1780 5 жыл бұрын
Tournament sort?
@lithiumwyvern_
@lithiumwyvern_ 4 жыл бұрын
That's because time sort isn't a real sorting algorithm. As the air accumulator said, time sort is just a horrible abuse of the system's scheduler - it creates one thread for every element, makes them wait (value of the element × 4) milliseconds then push the element onto the end of the output array, then insertion-sorts that array.
@MauveDash
@MauveDash 4 жыл бұрын
Slow sort
@nick1752
@nick1752 4 жыл бұрын
@@lithiumwyvern_ ngl that's kinda genius
@Drachi-
@Drachi- 4 жыл бұрын
2倍速で聴くとめちゃくちゃ気持ちいいです! I love listening to it at double speed.
@tizianodellafazia2309
@tizianodellafazia2309 4 жыл бұрын
Ahhh yes it's this time of the year.... youtube strikes again with that algoritm stuff
@nordern1
@nordern1 4 жыл бұрын
The algorithm wants to show off its family
@pestermaster7617
@pestermaster7617 2 жыл бұрын
Batcher's bitonic sort: shakes a bit here and there, decides that it is wrong, Puts it back, and then decides that it prefers the list sorted.
@brandonklein1
@brandonklein1 4 жыл бұрын
Really shows the difference between n^2 vs nlog(n)
@h0verman
@h0verman 5 жыл бұрын
its cool how with starting reversed some sorts approach a fractal pattern initially
@zapdragon5942
@zapdragon5942 5 жыл бұрын
Then there's Odd-Even
@icebearpl188
@icebearpl188 5 жыл бұрын
Base16 made some sort of rbg boss battle theme intro
@kirbycreep
@kirbycreep 5 жыл бұрын
@@icebearpl188 some *_sort_*
@Remon_
@Remon_ 4 жыл бұрын
5:26 sounds like pulling off a long piece of plastic on a new surface
@ONS0403
@ONS0403 5 жыл бұрын
Quick sort is the one true god... considering its performance and how quick it is to write
@romajimamulo
@romajimamulo 4 жыл бұрын
Except this is actually the worst case scenario
@Fera-gr5mm
@Fera-gr5mm 4 жыл бұрын
@@romajimamulo Only if it was choosing the last/first element. In this case, the middle element is the median, so this is pretty effective.
@romajimamulo
@romajimamulo 4 жыл бұрын
@@Fera-gr5mm That is true.
@entropic-decay
@entropic-decay 4 жыл бұрын
odd-even sort: *just turns it around in 3D*
@jamesallen74
@jamesallen74 2 жыл бұрын
No matter what the sorting video is, Radix LSD Base 4 NEVER fails to impress me in terms of awesomeness and beauty. :)
@Fireball7428
@Fireball7428 Жыл бұрын
And it also sounds great.
@What-thaW
@What-thaW 5 жыл бұрын
5:26 Cha cha real smooth
@timetree4124
@timetree4124 4 жыл бұрын
5:23 Selection Sorts: Smooth Sort Looks: *Rough*
@wymarsane7305
@wymarsane7305 Жыл бұрын
4:50 "I worked so hard, and got so far But in the end, it didn't even matter"
@Scudmaster11
@Scudmaster11 Жыл бұрын
7:45 patience sort be like
@Poopooproductions1
@Poopooproductions1 3 жыл бұрын
11:11 drops sick beat
@SHIN2025_official
@SHIN2025_official 3 жыл бұрын
5:11 Weak heap sort: I AM NOT WEAK
@sumandbastitv2606
@sumandbastitv2606 2 жыл бұрын
Strong heap sort?
@GoldenGamerFox7272fromYT
@GoldenGamerFox7272fromYT 5 жыл бұрын
imagine you had 8 pencils and had to do 125984 comparisons, 585800 swaps and 1171600 writes to main array to sort them from smallest to biggest. thats the bogo sort. (27:01)
@CatFace8885
@CatFace8885 Жыл бұрын
Pancake sort constantly reversing the already sorted array over and over not knowing any better is such a moment
@Gamesmarts194
@Gamesmarts194 5 жыл бұрын
“Impractical sorts” lol
@raine6813
@raine6813 4 жыл бұрын
12:57 "maybe if i put this he- no that dosent work. maybe if i did thi- no that dosent work either. maybe if i jus- oh god now i gotta start all over..."
@gameborge
@gameborge 2 жыл бұрын
counting sort when pigeonhole sort walks in
@pinguin4898
@pinguin4898 4 жыл бұрын
heap sort is extremely powerful here because it's already all in a heap
@MsZiomallo
@MsZiomallo 4 жыл бұрын
Pigeonhole sort (10:37): *I AM SPEED*
@MaximG.
@MaximG. 4 жыл бұрын
11:14 - this reminds me of Metroid Prime title screen for some reason
@littlelamp100
@littlelamp100 3 жыл бұрын
22:31 windows trying to search for a file
@aaplies8879
@aaplies8879 Жыл бұрын
I really have to appreciate min heap sort (4:38) taking all the extra time to reform the input then flip it.
@The4stro
@The4stro 4 жыл бұрын
stable quick sort was like trying to start an engine, and it finally starting
@NStripleseven
@NStripleseven 4 жыл бұрын
Batcher's bitonic sort undoes itself many more times than is necessary. 13:00
@KingofJ95
@KingofJ95 5 жыл бұрын
Silly Sort: Who are you? Merge Sort In Place: I'm you, but stronger.
@LandonM_Earth
@LandonM_Earth 2 жыл бұрын
0:33 looks like a reversed image of the original zooming out of existence
@korriannavanheart8911
@korriannavanheart8911 Жыл бұрын
Dreams be like: you must go up these stairs The stairs:
@grande1900
@grande1900 2 жыл бұрын
It's called pancake sort because it looks and sounds like a frozen pancake spinning like a coin
@nouche
@nouche 2 жыл бұрын
Is it me or did Bogo Sort get quite lucky there?
@sharpesttoolintheshed492
@sharpesttoolintheshed492 4 жыл бұрын
Gravity sort be like: 1) have values to sort 2) look at them 3) ??? 4) profit
@californium-2526
@californium-2526 3 жыл бұрын
A slow one though. Pigeon hole sort, counting sort and TimSort would have fit.
@nouche
@nouche 2 жыл бұрын
Quick Sort is known to be pretty bad in this case, as well as when it’s already pretty much in order. On the contrary, Heap Sort(s) are known to be pretty darn good in every case.
@BigFatWedge
@BigFatWedge Жыл бұрын
Well, a reversed array is necessarily a heap, so Heap Sorts already have half their work done for them in this case. I imagine they don't do so well if the array is sorted/is close to being sorted, because an array in ascending order is what might be dubbed an anti-heap--no part of the heap is correct. Quick Sort only struggles because usually, it's programmed to just choose the last item as the pivot, which is bad If that's the biggest/smallest item. If you code it to just pick a random item from the list as a pivot, though, it performs just as well as any other time. Also, Heap Sort is the worst O(n log n) sort on average, and Merge Sort does better in "all cases." So you're wrong .
@bingobeego
@bingobeego Жыл бұрын
​​@@BigFatWedgeigeonhole? Or even timsort
50+ Sorts, Visualized - Scatter Plot
30:21
Musicombo
Рет қаралды 744 М.
Visualizing 70 Sorting Algorithms
29:24
Kuvina Saydaki
Рет қаралды 243 М.
Vampire SUCKS Human Energy 🧛🏻‍♂️🪫 (ft. @StevenHe )
0:34
Alan Chikin Chow
Рет қаралды 138 МЛН
Jaidarman TOP / Жоғары лига-2023 / Жекпе-жек 1-ТУР / 1-топ
1:30:54
Too Pretty for Calculus
17:03
Goofy Historians
Рет қаралды 4,1 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 307 М.
TAS Explained: Super Mario Bros. 3 in 0.2 seconds
19:39
100th Coin
Рет қаралды 548 М.
50+ Sorts, Visualized - Swirl Dots
28:44
Musicombo
Рет қаралды 839 М.
LSD Radix Sort
12:32
Musicombo
Рет қаралды 60 М.
*SEIZURE WARNING* Pushing Sorts to their Limits
59:06
Musicombo
Рет қаралды 5 МЛН
Mandelbrot's Evil Twin
7:47
2swap
Рет қаралды 611 М.
Notation Must Die: The Battle For How We Read Music
1:16:21
Tantacrul
Рет қаралды 1,3 МЛН
Fast Inverse Square Root - A Quake III Algorithm
20:08
Nemean
Рет қаралды 5 МЛН
*SEIZURE WARNING* 50+ Sorts, Visualized - Rainbow
31:38
Musicombo
Рет қаралды 391 М.