Why is this one of the funniest things I've ever seen and what's wrong with me?
@CatoSierraWasTaken6 жыл бұрын
interesting how it creates an approximate sort relatively quickly. Maybe a few passes of this and then feeding it to something that works well on nearly sorted lists (like linear insertion) would be a good idea.
@raffimolero642 жыл бұрын
that's actually exactly what it does. it makes an approximate sort, then feeds it into a smaller version of itself. if you want an insertion sort version, use shellsort.
@matthewzhao73169 жыл бұрын
Starts off fast, then at the end it takes forever to sort.
@richardhuang85129 жыл бұрын
+MATTHEW ZHAO yeah its my favorite sorting algorithm. well second favorite. I think we all know my first favorite ;)
@richardhuang85129 жыл бұрын
+MATTHEW ZHAO sex
@groszak18 жыл бұрын
Bubble sort has always the part that "takes forever". Comb sort makes some faster passes that make it ... faster.
@mac6na6na264 жыл бұрын
Generally you would put a different sort like bubble sort at the end
@spencerandersen27110 жыл бұрын
Love this algorithm; when audibilized it sounds like Super Mario.
@Zxoro6 жыл бұрын
0:40 when you try playing the piano for the first time
@afj8104 жыл бұрын
CHROMATIC SCALE
@humanoidx977 Жыл бұрын
sound like some liszt cadenza
@Drivenout7 жыл бұрын
00:39 Time keeps on slippin slippin slippin into the future~
@ATIHpss64HM4 жыл бұрын
Lol
@ATIHpss64HM4 жыл бұрын
U a steve miller fan?
@AriTheMothQueen4 жыл бұрын
Two workers doing a job. Im proud of em
@quink20607 жыл бұрын
I'd think this'd be best if there was a way to detect if all elements were within like 5 or 10 places of their proper place, then another sort could come in, where it'd be faster with a near-sorted list.
@groszak17 жыл бұрын
Comb Sort _is_ doing large gapsize passes to cause list to become nearly sorted, however they are bubble passes, and switching to 1-passes quickly would not lead to much improvement, because many passes are needed anyway. If you want a sort with insertion passes and fewer of them, go to Shell Sort.
@joedempseysr.33767 жыл бұрын
The Comb Sort is inefficient. Somewhere between the Shell Sort and Bubble Sort. I prefer the LSD First Radix Sort for integers and Quick Sort for everything else. I generally use the Insertion Sort within the Quick Sort for the small buckets. I also test all sorting algorithms on each platform before deploying in the field. In this way, I can tweak the algorithms for optimal performance.
@bbdare78746 жыл бұрын
It's definitely inefficient, but that's just because it was only ever designed as a minor improvement to Bubble sort. it's supposed to more quickly handle "turtles" or the large values that are closer to the start, as this slows down bubble sort plenty due to it not being able to move it across the array quickly.
@nunsense94896 жыл бұрын
@@bbdare7874 nerds
@raffimolero646 жыл бұрын
@@nunsense9489 the kind that builds computers and allows you to have youtube sort by most liked
@comet98642 жыл бұрын
@@raffimolero64 lol
@Ambipie4 жыл бұрын
Paid by the hour and fed right on up, its Comb Sort, goofing around with a comb waiting for the deadline.
@zerosora85207 жыл бұрын
lol the last when the distance=2 it does one useless run
@Ramzuiv7 жыл бұрын
ZeroSora: It’s not actually useless- while it’s obvious to the human eye that the list is sorted, the algorithm doesn’t actually know that, so it has to check to make sure. Remember that this occurs over the span of less than a millisecond in real life.
@raffimolero647 жыл бұрын
it's not guaranteed that when the distance is 2 it will be sorted next round, so it checks.
@BlackXxScopez6 жыл бұрын
Mikk W it is useless though. Good sorts have flags for when they're already sorted, and are set as true by default. The flag is only set as false when the algorithm makes a swap.
@Isaic026 жыл бұрын
@@BlackXxScopez It would take longer to check the flag every run than it does to run that last run.
@BlackXxScopez6 жыл бұрын
@@Isaic02 checking flags is linear, but the savings checking them create more than make up for it
@groszak17 жыл бұрын
What the heck? How did you get comb sort to work so poorly? More than one 1-pass was needed to eliminate all inversions. A good comb sort parameter choice would _usually_ end all inversions in one 1-pass, not counting the second pass needed to ensure proper sorting.
@raffimolero647 жыл бұрын
this is one of the cases that isn't part of _usually_
@groszak17 жыл бұрын
I have Sound Of Sorting and I notice it often.
@strangent404a76 жыл бұрын
"We an't found shit!" Spaceballs
@Obstagoon8628 жыл бұрын
What's the difference between the comb and shell sorts?
@LadyZechie8 жыл бұрын
Comb Sort works like an upgraded Bubble Sort by comparing two elements and swapping them, except the elements are a certain distance away rather than right next to one another. The distance at which elements are compared is decreased per each complete interval until they're right next to each other, in which case it's the same as Bubble Sort (but hopefully it should complete sorting relatively soon after it hits that point.) Shell Sort works similarly in that the compared elements aren't always right next to each other, BUT Shell Sort compares more than 2 elements at most times. From when it begins sorting, Shell Sort sorts every nth element of the list so that every nth element is sorted as you want them to be, while reducing n every interval until it's comparing every element to one another, at which point it's the same thing as Bubble Sort. (It's also worth noting that I'm not a master of sorting algorithm knowledge, I only started getting into how these all work recently so I can't honestly get into specifics like time complexity and best/worst case scenarios or where Bubble/Comb/Shell would each be better than one another)
@gisibah8 жыл бұрын
Zechling i'd say shell sort is an upgraded insertion sort rather than bubble sort
@want-diversecontent38876 жыл бұрын
Samurott Gaming Inc. wrong.
@dlwatib5 жыл бұрын
You're wrong about Shell sort comparing more than 2 elements at a time. There is no computer instruction that can compare more than two elements at once. What's actually happening is that Shell sort is doing an insertion sort with gaps. Instead of sorting every element, it's sorting every 5th element, etc., then shortening the gap until the entire list is sorted. Comb sort just bubbles elements closer to their final destination, it doesn't completely sort its sublists like Shell sort does.
@samb4435 жыл бұрын
isnt this video misnamed, this looks like shell sort, not comb
@princessemila80566 ай бұрын
This is not the original EAS alarm. The audio is from a video called Comb Sort.
@Asdfghkll495 ай бұрын
What
@ovi13264 жыл бұрын
Ah yes, jazz music
@jazzyboyem7b5694 жыл бұрын
As a jazz musician i can confirm this.
@narucy5611 жыл бұрын
We love Comb Sort!
@itspinebro Жыл бұрын
beep boop beeeep boop i dont understand but brain go weee
@perpendicularfifths73123 жыл бұрын
starting up, dont step on yet
@yamibakura88056 жыл бұрын
crab sort?
@smestre6 жыл бұрын
aka poor man's Shell sort?
@bethmadden829 ай бұрын
Comb Sort
@SouravDash967 жыл бұрын
better to tell the algo
@wowyeah6669 жыл бұрын
816
@ALLCAPS6 жыл бұрын
Pretty gay. It's almost as bad as the bubble sort. It's like running two threads of bubble sort through some program. LOL! E. Z.