10 FORBIDDEN Sorting Algorithms

Ойын-сауық

If you to upgrade your workstation too, don't miss their sale now and use my code ''YTB50'' for $50 off on order over $500.
FlexiSpot E7 standing desk: bit.ly/44VUYtr - US
bit.ly/46Vvluo - Canada
In this video, I explored the realm of impractical sorting algorithms. Say goodbye to the usual and practical methods, and join me on a journey through a collection of algorithms that are downright wacky. We'll have a laugh while shedding light on the inefficiency and pure silliness of certain sorting approaches.
Chapters:
Introduction - 0:00
Sponsor - 1:08
Stalin Sort - 2:40
Sleep Sort - 3:17
Slow Sort - 3:59
Bogo Sort - 4:45
Bozo Sort - 5:20
Bogo Bogo Sort - 5:40
Quantum Bogo Sort - 6:28
Schrodinger's Sort - 7:09
Intelligent Design Sort - 7:41
Miracle Sort - 8:22
Outro - 8:53
💻 Instagram: / im.ardens
💻 Discord: / discord
💻 GitHub: github.com/myNameIsArdens

Пікірлер: 2 300

  • @Ardens.
    @Ardens.9 ай бұрын

    If you to upgrade your workstation too, don't miss their sale now and use my code ''YTB50'' for $50 off on order over $500. FlexiSpot E7 standing desk: bit.ly/44VUYtr - US bit.ly/46Vvluo - Canada

  • @edwardlemay1955

    @edwardlemay1955

    9 ай бұрын

    YO WHAT!? Never heard of FlexiSpot in my life until 3 weeks ago when I bought my E8, and I must say that I regret absolutly nothing 🤣

  • @Scudmaster11

    @Scudmaster11

    9 ай бұрын

    There is also Silly sort... and yes I have built afew custom ones... my joke one is known as child sort.... as I remember... 430,250 comparisons to sort 20 elements

  • @yigawaffle

    @yigawaffle

    9 ай бұрын

    Flexispot is collecting youtubers like infinity stones.

  • @user-xe5sj8yx6y

    @user-xe5sj8yx6y

    9 ай бұрын

    Crushed like a submarine brother 😂 2:15

  • @TopRob1

    @TopRob1

    9 ай бұрын

    Make a video about algorythm in general. I have no plan, how to create one actually 😬😅

  • @aeolianaether
    @aeolianaether9 ай бұрын

    Thanos Sort: Randomly remove half of the elements until all the remaining are sorted.

  • @AlexM1983DHUN

    @AlexM1983DHUN

    8 ай бұрын

    Tezcatlipoca Sort: you copy the sorted list using a smoking mirror to see into the future where the list is already sorted.

  • @keit99

    @keit99

    8 ай бұрын

    So mergesort without the merge part 😂

  • @tapist3482

    @tapist3482

    8 ай бұрын

    Worst case:O(logn), where you delete everything but 1 element.

  • @AlexM1983DHUN

    @AlexM1983DHUN

    8 ай бұрын

    @@tapist3482 Sorry, but deleting elements takes also time not to speak of checking the remaining list if its sorted. Discarding the half randomly if it's not sorted. So for the worst case: You have N elements, you check if the list is sorted, that's N-1 steps, then you discard half of it, that's N/2 elements to be deleted. Now, you have N/2 elements, N/2-1 checks and you discard half of it again, that's N/4. ... You have 2 elements, that's a single check, you remove an element. You have 1 elements, that's a single check, you have finished the Thanos Sort. That's a total of sum(2^m+2^m/2)+1, where m=dlog2(N)..0 = ~3N => O(N), (dlog2 stands for discrete 2 based logarithm), almost same as Stalin Sort, but with more expected casualties, and it seams to be 1.5 times slower in the worst case.

  • @tapist3482

    @tapist3482

    8 ай бұрын

    @@AlexM1983DHUN You're right. I really missed the part where the algorithm is still meant to sort stuff, so the checking step is necessary.

  • @almuaz
    @almuaz7 ай бұрын

    Gaslight Sort: - Take unsorted list. - Tell user, it is already sorted.

  • @sakesaurus1706

    @sakesaurus1706

    4 күн бұрын

    eerily similar to the intelligent design sort

  • @SPL1NTER_SE

    @SPL1NTER_SE

    3 күн бұрын

    Someone else came up with this 3 months before you. :(

  • @michaeluhrig6957
    @michaeluhrig69579 ай бұрын

    I'm a big fan of Intern Sort. Whenever something needs to be sorted, a ticket is created and sent to an intern to manually copy and paste the elements back in the correct order.

  • @privacyvalued4134

    @privacyvalued4134

    8 ай бұрын

    Except their Jira access has been revoked for some obscure reason and another support ticket has to be opened first to reinstate access.

  • @jameswalker199

    @jameswalker199

    8 ай бұрын

    @privacyvalued4134 and after that the ticket is closed with a "wontfix" because the unsorted list is already in the expected order.

  • @alaeriia01

    @alaeriia01

    6 ай бұрын

    Isn't that just how Miracle Sort actually works?

  • @Emulleator

    @Emulleator

    5 ай бұрын

    @@alaeriia01 no, miracle sort is more like if you never create a ticket but still expect the intern to somehow know your list needs sorting and regularly check if they ave done so

  • @pianissimo7121

    @pianissimo7121

    3 ай бұрын

    In my office, actually employees don't have access from day 1 for over a month, meanwhile interns gets their access immediately ​@@privacyvalued4134

  • @technoeevee6969
    @technoeevee69699 ай бұрын

    Preplanning Sort: Input your initial data in a sorted order in the first place, thus removing the need to sort it.

  • @kooskoos12345

    @kooskoos12345

    4 ай бұрын

    O(0)

  • @patricktho6546

    @patricktho6546

    2 ай бұрын

    That's kinda the argument of sort by intelligent design

  • @FoxSlyme

    @FoxSlyme

    2 ай бұрын

    This actually exists and is called an insertion sort

  • @kooskoos12345

    @kooskoos12345

    2 ай бұрын

    @@FoxSlyme what?? Insertion sort is an actual algorithm people use

  • @FoxSlyme

    @FoxSlyme

    2 ай бұрын

    @@kooskoos12345 yes that's exactly what I'm saying

  • @sideeffectdk
    @sideeffectdk9 ай бұрын

    Moving Goalpost Sort: Take an unsorted array [8,1,6,0], re-define all numbers in mathematics so it is now sorted which means [8

  • @californium-2526

    @californium-2526

    9 ай бұрын

    O(n) runtime, how amazing! No elements removed as well!

  • @neopalm2050

    @neopalm2050

    9 ай бұрын

    @@californium-2526 O(0), in fact. The entire sorting algorithm is a no-op (just like intelligent design sort. Oh wait. Those are actually pretty much the same sort.)

  • @droidBasher

    @droidBasher

    9 ай бұрын

    Similar is Tao sort, which, given a list to be sorted, returns a new ordering method where they are already sorted.

  • @incription

    @incription

    9 ай бұрын

    @@neopalm2050 well, technically it is O(n) because you need to actually read the array to define the numbers

  • @neopalm2050

    @neopalm2050

    9 ай бұрын

    @@incription Not if the "redefining" is done at compile time (meaning the type changes rather than any actual data).

  • @GioDoesStuff
    @GioDoesStuff9 ай бұрын

    Miracle sort is basically me checking my empty fridge every hour or so to see if, miraculously, some food spawned in.

  • @tomsko863

    @tomsko863

    9 ай бұрын

    Miracle Sort, also known as the "Thoughts and Prayers" Sort.

  • @vinhlo2637

    @vinhlo2637

    9 ай бұрын

    My first action when get back home is always check the damn fridge. And sometime the food (also drink) spawns into :v

  • @saddexed

    @saddexed

    16 күн бұрын

    or a girl, if you are Delhite enough.

  • @erickiliany
    @erickiliany3 ай бұрын

    I recall learning about very fast sorting algorithm in my algorithms class which I surprisingly haven’t seen mentioned here. Multiply the entire array by 0 and now it’s sorted. I think it should be called “Kachow” sort because of its speed:

  • @Farzriyaz

    @Farzriyaz

    Ай бұрын

    Sort the list: ["cow", "dog", "pig", "you😂"]

  • @catchara1496

    @catchara1496

    29 күн бұрын

    @@Farzriyaz[“”, “”, “”, “”]

  • @thefatcontrollershat

    @thefatcontrollershat

    19 күн бұрын

    This reminds me of how when I was learning to balance equations in Chemistry, I would do so easily by writing 0 in front of all compounds

  • @GeometryDashLover3344

    @GeometryDashLover3344

    8 күн бұрын

    @@Farzriyaz [NaN, NaN, NaN, NaN] looks sorted to me 👍👍

  • @eeddeellwweeiiss
    @eeddeellwweeiiss8 ай бұрын

    Bruteforce Sort: 1. Create an array of all possible n! permutations of the array to be sorted 2. Mark each array as "sorted = false". 3. For each array, make sure that each of its elements is not less than the previous one. If so, mark the array as "sorted = true". 4. Filter the array of arrays using "array.sorted === true" 5. The first element of the filtered array of arrays should be your sorted array.

  • @glumbortango7182

    @glumbortango7182

    8 ай бұрын

    Hooray, O(n!), my favorite!

  • @fragileomniscience7647

    @fragileomniscience7647

    8 ай бұрын

    Quantum sort: Bomb it with cosmic rays, eventually they'll bit shift into correct order.

  • @woobilicious.

    @woobilicious.

    8 ай бұрын

    @@glumbortango7182 most sort algos are O(n) for memory consumption, This one is uniquely bad because it's a factorial in both time and memory usage lol.

  • @donaldhobson8873

    @donaldhobson8873

    8 ай бұрын

    You can make this worse. How do you iterate through all possible permutations. Well, pick each possible element as the first element. Then sort the rest with brute force sort. So in python that's def bruteforce(x): y=list(permute(x)) for i in y: for j,k in zip(i,i[1:]): if j>k: break else: return i def permute(x): if len(x)==0: yield [] return for i in x: for j in permute(bruteforce(list(filter(lambda j:j!=i,x)))): yield [i]+j

  • @onehandbehind343

    @onehandbehind343

    6 ай бұрын

    @@fragileomniscience7647thats miracle sort, basically.

  • @welovemrp00
    @welovemrp009 ай бұрын

    I'd like to propose "The Liar's Sort". This is where you have two machines with the same data. You let one machine do the actual sorting, and once it's done, you use the completed sort to sort the data on the second machine, making it look like it was sorted in one cycle.

  • @joshuanorman2

    @joshuanorman2

    8 ай бұрын

    Alternative title: Reaction KZreadr sort

  • @foogod4237

    @foogod4237

    8 ай бұрын

    Amusingly, the "thread sort" mentioned in the video is technically a version of this algorithm. (The thread sort relies on the OS using its own (different) sorting algorithm to order the wake-up times of the threads, so it's technically not sorting anything itself at all, it's just taking the output of a different sorting algorithm (with a few extra steps) and presenting it as its own).

  • @caltheuntitled8021

    @caltheuntitled8021

    8 ай бұрын

    Isn’t that kind of just “intelligent design sort”? The other computer is the intelligent sorter.

  • @niemand262

    @niemand262

    8 ай бұрын

    No joke, that is basically what happened as the "draft" of the Human Genome. Celera used the public HGP data, digitslly chopped it up into "faux read" data, and then reassembled the data and declared success. But, they did not randomly sample from the pool of faux reads, thus the set contained all the necessary information to reconstruct the sequence. John Sulston spent 10% of his 2002 memoire describing this big lie.

  • @count69

    @count69

    7 ай бұрын

    A variation on that is the Liar's Homwowrk Sort where the machine reports that the sort was successful. When pushed for the data it stalls for time while it sorts the data in Google at the last minute

  • @NeovanGoth
    @NeovanGoth9 ай бұрын

    Miracle sort can actually work: With an extremely low probability, cosmic rays could flip enough bits in memory to eventually result in a sorted list, that, with an even lower probability, might contain the original elements. The downside is that with a much higher probability, other bit flips occurring during that time will crash the program. Another downside is that just like Bogo Sort, Miracle Sort is not guaranteed to halt.

  • @Cm-22000

    @Cm-22000

    9 ай бұрын

    Mario 64

  • @felipevasconcelos6736

    @felipevasconcelos6736

    9 ай бұрын

    In 2013, a Super Mario 64 speedrunner experienced what is thought to have been a single-event upset, where one bit that defined Mario’s position flipped, teleporting him up with no known side-effects.

  • @pedropesserl

    @pedropesserl

    9 ай бұрын

    bogo sort is garanteed to halt by the infinite monkey theorem, just not in a reasonable amount of time. for miracle sort, I guess if you assume a constant flow of cosmic rays and infinite time, it could be garanteed to halt too

  • @felipevasconcelos6736

    @felipevasconcelos6736

    9 ай бұрын

    @@pedropesserl neither is guaranteed to halt before the heat death of the universe. You need infinite time to be sure they halt, which’s fine for bogosort: it’s an abstract algorithm, it can run in the infinite universe of mathematics. You can’t do the same with miracle sort, though. It only works if it’s a physical computer with transistors and stuff that lives in the Universe, so the algorithm itself can only run until the heat death of the universe.

  • @pedropesserl

    @pedropesserl

    9 ай бұрын

    @@felipevasconcelos6736 that's exactly what I meant

  • @beancicle4607
    @beancicle46078 ай бұрын

    overwrite sort: set the value of the 1st element in the list to 1, the 2nd to 2, the 3rd to 3 and so on until you reach the end of the list.

  • @gcewing
    @gcewing9 ай бұрын

    Lookup Sort: Precompute sorted versions of all possible input lists and store them in a hash table. Then just look up the input in the table. Uses a lot of memory, but it's really fast.

  • @ferdinand.keller

    @ferdinand.keller

    7 ай бұрын

    Finally a O(1), working, (not) efficient sorting algorithm.

  • @ericmyrs

    @ericmyrs

    6 ай бұрын

    Mmm password rainbow tables.

  • @LB-qr7nv

    @LB-qr7nv

    6 ай бұрын

    @@ferdinand.keller no, hashing a list is O(n) I think

  • @ferdinand.keller

    @ferdinand.keller

    6 ай бұрын

    @@LB-qr7nv Ha, true, it’s O(n). You are right.

  • @rolfs2165

    @rolfs2165

    6 ай бұрын

    Important clarification: it's very fast _at run-time!_

  • @Mitch-xo1rd
    @Mitch-xo1rd9 ай бұрын

    Why not combine thread sort and bogo sort? Shuffle the array, create a new thread for each element, and use that to check if they are in the right order.

  • @youssefmic

    @youssefmic

    9 ай бұрын

    The most complicated useless thing everrrr 😂😂

  • @sword0948

    @sword0948

    9 ай бұрын

    I guess if you had a few millions threads this could be very fast xd

  • @valk_real

    @valk_real

    9 ай бұрын

    This but with Quantum Compute 🤔

  • @capsey_

    @capsey_

    9 ай бұрын

    @@sword0948 forkbomb moment

  • @Swagpion

    @Swagpion

    9 ай бұрын

    That's like my idea, make it so any correct group like "OPQ" is made into one element then randomoze the sequence again. This is exponenionaly better, because the sequence slowly shrinks untill it is 1 element, making it end.

  • @florisvenselaar6543
    @florisvenselaar65439 ай бұрын

    Random construction sort: 1. Construct a random sorted list. 2. Check if the sorted and unsorted list contain the same elements. 3. Repeat until a match is found.

  • @jasperbarnett6819

    @jasperbarnett6819

    9 ай бұрын

    I'd like to propose the names monkeysort or typewritersort for this process, in reference to the infinite monkeys on infinite typewriters writing Shakespeare thought experiment

  • @jasperbarnett6819

    @jasperbarnett6819

    9 ай бұрын

    Or, a more absurd version. Generate a random list. Check if it is the sorted version of the original list. If yes, halt. If no, repeat.

  • @jackik1410

    @jackik1410

    8 ай бұрын

    @jasperbarnett6819 but to check, you would need a sorted version of the original list, eh? XD

  • @jasperbarnett6819

    @jasperbarnett6819

    8 ай бұрын

    @@jackik1410 no, you would just need a copy of the original list (unsorted). Then just run two checks: one, that the generated list is sorted, and two, that it contains each element of the original list, and nothing else

  • @jackik1410

    @jackik1410

    8 ай бұрын

    @@jasperbarnett6819 right, fair point, two checks

  • @trail_mix24
    @trail_mix245 ай бұрын

    miracle sort sounds like me doing essays back in high school

  • @privacyvalued4134
    @privacyvalued41348 ай бұрын

    Here are a bunch of O(1) sorting algorithms: *Dictator Sort:* Select the first element of the array by position and remove the rest of the elements because they are inconsequential. The downside is that there is now only one element in the array but it is always sorted. Unfortunately, the dictator also becomes a peasant by position. *Peasant Uprising Sort:* Select the last element of the array by position and remove the rest of the elements because they came before your element's position. The downside is that the peasant becomes the dictator by position. *Jesus Sort:* Select either the first or the last element of the array. The least position shall become the greatest or the greatest position shall become the least in the kingdom of one element arrays. *Nazi Sort:* Randomly select one element in the array to survive. This sort is terrible for many reasons that should not have to be explained.

  • @matthewmitchell3457

    @matthewmitchell3457

    5 ай бұрын

    Here's what I got from that: class NaziSort { // Nazi Sort implementation } class JesusSort extends NaziSort { // Implementation } class DictatorSort extends JesusSort { // Implementation } class PeasantUprisingSort extends JesusSort { // Implementation }

  • @humanity2809

    @humanity2809

    5 ай бұрын

    this guy is a genius

  • @efivip93

    @efivip93

    5 ай бұрын

    Laughed so much... 😂

  • @mienislav

    @mienislav

    4 ай бұрын

    Dictator Sort and Peasant Uprising Sort are O(n) due to removal of the remaining elements

  • @_somerandomguyontheinternet_

    @_somerandomguyontheinternet_

    Ай бұрын

    *Batman Sort:* Print “Because I’m Batman.” The list is now sorted, and anyone who says otherwise must be insane and will be sent to Arkham Asylum.

  • @Pyronimous
    @Pyronimous9 ай бұрын

    Political sort - have an unsorted list, say [9, 7, 1, 3, 4, 0, 8, 5, 2, 6], proceed by actively lobbying governments in all countries in the world to change meaning of the written numbers so that the list would appear sorted. E.g change the meaning of '9', so it's actually 0, '7' is actually 1 and so on.

  • @allenhuntsman

    @allenhuntsman

    9 ай бұрын

    That's messed up...or maybe you could argue and continue to make sure the whole computer or pc would believe the same thing to be true

  • @toifel

    @toifel

    9 ай бұрын

    pay2sort

  • @Nugcon

    @Nugcon

    9 ай бұрын

    That would require a world governing new world order to effectively make those changes, so literally 2618

  • @flappyboi38

    @flappyboi38

    9 ай бұрын

    I commented the same idea, sorry

  • @richardpowell1425

    @richardpowell1425

    9 ай бұрын

    @@Nugcon countries could sign treaties it have a common meaning for those lists without one body being in charge of everybody.

  • @namenamington
    @namenamington9 ай бұрын

    Undefined Sort: Mark the space in the memory used by the list that is to be sorted as free and then check up on it after the computer has had time to reuse the memory space and hope that whatever happens to be in memory is the sorted version of the list.

  • @KanashimiMusic

    @KanashimiMusic

    9 ай бұрын

    It would probably be very hard to implement this, because the program would have to be able to get access to the same section in memory repeatedly. However, a similar method would work and is actually insanely easy: malloc with the desired amount of bytes, check if the allocated memory is in order, if not, malloc again. Do this until you run out of memory or an ordered list is found in memory. Why am I giving this any serious thought? I have no frickin idea.

  • @evilsheepmaster1744

    @evilsheepmaster1744

    9 ай бұрын

    If Bogosort and Miracle Sort had a baby. A hideous, hideous baby.

  • @catsnorkel

    @catsnorkel

    9 ай бұрын

    I love a sorting algorithm that can corrupt data from entirely different processes

  • @H2Obsession

    @H2Obsession

    9 ай бұрын

    A more practical Miracle Sort... I like it!

  • @EliasKaydanius

    @EliasKaydanius

    9 ай бұрын

    @@catsnorkel well, you wouldn't corrupt it, because you're just reading it

  • @thomasrichie2931
    @thomasrichie29315 ай бұрын

    Mutation Sort: Works by "mutating" the items in the list until they all fit The algorithm will loop through the items and check each item to see if it is less than the previous item. If it is, it will increment the item by 1 until it is bigger than the previous element.

  • @BiaginiMatt
    @BiaginiMatt8 ай бұрын

    The Bethoven sorting: It takes each element of the array and compares with a note of the Beethoven's 5th If the note is ascending, it changes it with the next value, if it's descending it changes with the previous. At the end of the array check if it's sorted, if not, continues the song on the beginning of the array, until it's sorted (the song goes in a loop)

  • @gaysarahk

    @gaysarahk

    6 ай бұрын

    Is that guaranteed to eventually work?

  • @emdivine

    @emdivine

    2 ай бұрын

    @@gaysarahk if the list length is divisible by the length of Beethoven's 5th, and does not sort on first pass, I'm pretty sure it now loops forever

  • @Twisted_Code

    @Twisted_Code

    2 ай бұрын

    Bum bum bum buuuuuum!

  • @_somerandomguyontheinternet_

    @_somerandomguyontheinternet_

    Ай бұрын

    @@gaysarahkno. In fact, not only is it not guaranteed to halt; it’s highly likely to never halt.

  • @xinshengbing5743
    @xinshengbing57439 ай бұрын

    2:40 Seek and destroy 3:17 zzzzzz 4:00 *Better* mergesort 4:46 Theoretically the fastest sorting algorithm that exists 5:21 Bogosort but slower 5:41 Bogosort but Bogoer 6:28 Bogosort but with *serious* concequences 7:09 If I don't see it, it's not there 7:41 If it ain't broke, don't fix it 8:24 yes

  • @malkrie1444

    @malkrie1444

    9 ай бұрын

    The last one is literally just checking the fridge in the middle of the night to see if more food spawned.

  • @livedandletdie

    @livedandletdie

    9 ай бұрын

    @@malkrie1444 I feel so hurt that miracle sorting my fridge at 2am doesn't work.

  • @cubicinfinity2

    @cubicinfinity2

    9 ай бұрын

    I find sleep-sort really interesting.

  • @Theerik4443

    @Theerik4443

    9 ай бұрын

    @@malkrie1444more like waiting for bit flips

  • @rayn301

    @rayn301

    9 ай бұрын

    6:28 bogosort but quantum Stalin sort

  • @user-qw1rx1dq6n
    @user-qw1rx1dq6n9 ай бұрын

    How about a gravity sorting algorithm where you start an entire physics simulation and give each item a density based on its value where the list is then sorted based on each elements position in a liquid

  • @blacklight683

    @blacklight683

    9 ай бұрын

    Negative numbers:I believe I can fly

  • @samtheking5759

    @samtheking5759

    9 ай бұрын

    Does zero just stay in the air?

  • @Rafale25

    @Rafale25

    9 ай бұрын

    That's kinda like the counting sort, where the problem is with big numbers

  • @vibaj16

    @vibaj16

    9 ай бұрын

    there is a sorting algorithm called gravity sort

  • @tangentfox4677

    @tangentfox4677

    9 ай бұрын

    This is a real sorting algorithm that is actually useful for some sorting problems (where there is a huge amount of data, an answer is needed quickly, and the precision of the answer isn't that important - only most elements need to be in the correct position).

  • @vencelfoldi8236
    @vencelfoldi82368 ай бұрын

    Over the years, I've become a master of miracle sorting my problems in my life.

  • @BMXLore
    @BMXLore9 ай бұрын

    Solution to Sleep Sort's issues - divide all numbers by the largest possible value able to be stored in the device's memory, reducing them to decimals between the value of -1 and 1. Then, add to each number 1, so the possible values are between 0 and 2, then use Sleep Sort. I'm fairly certain this will be O(n).

  • @tetrachart4156

    @tetrachart4156

    3 ай бұрын

    Well it's correct, but at this point you can just do bucket sort instead.

  • @Akira-Aerins

    @Akira-Aerins

    3 ай бұрын

    bro out here with big brain

  • @talinpeacy7222

    @talinpeacy7222

    28 күн бұрын

    Change the sleep timer to system ticks instead of seconds.

  • @p3chv0gel22
    @p3chv0gel229 ай бұрын

    At university, me and a few others worked with a group from our physics lab. They wanted to design a robot for an hypothetical Experiment with radioactive sources. During this we came up with the idea for radiation sort: You take your array, dump it into a poorly shielded memory, push that next to a strong radiation source and wait until the radiation causes enough bits to flip so that you know have the data in Order Now that i think about it, given that the data would be destroyed and recreated in the process, this could also be called Theseus sort (as in ship of theseus)

  • @WillBinge

    @WillBinge

    9 ай бұрын

    I like the name Theseus sort

  • @OnFireByte

    @OnFireByte

    9 ай бұрын

    TBH every sort is kinda Theseus sort if you think about it

  • @khairinazrin

    @khairinazrin

    9 ай бұрын

    This is literally miracle sort that utilizes cosmic radiation flipping a bits but at a much higher rate.

  • @Greenicegod

    @Greenicegod

    9 ай бұрын

    It seems to me more like a monkey's typewriter sort. Or perhaps the Library of Babel sort.

  • @pedroivog.s.6870

    @pedroivog.s.6870

    9 ай бұрын

    They could use it for actual rng for better security, as the damage is probabilistic (right?)

  • @jammerhammer1953
    @jammerhammer19539 ай бұрын

    Yes Man sort, which is even faster than BOGO sort Given an unsorted set, the algorithm randomizes the set and reports that the list is in order, regardless of whether or not the set is actually sorted. This is potentially faster than BOGO sort, because in the instance that it does happen to be in order on the first try, it doesn't waste time checking if it is in order. This does have the downside of occasionally ending before the set is sorted.

  • @mcjavabelike8320

    @mcjavabelike8320

    9 ай бұрын

    occasionally

  • @fenec250

    @fenec250

    9 ай бұрын

    Quantum bogo sort works just as fast and has no downside, as long as you follow the right quantum branch.

  • @JensPilemandOttesen

    @JensPilemandOttesen

    9 ай бұрын

    Hard sort: Return an hardcoded sorted array. Given any array, it will return a sorted array in O(1)

  • @TojiFushigoroWasTaken

    @TojiFushigoroWasTaken

    9 ай бұрын

    ​@@fenec250true...i always use quantum bogo sort despite the desperate wails of mercy from all the beings in the parallel universes we just destory.....its just too fast to not be used

  • @double7s41

    @double7s41

    9 ай бұрын

    Blind Man sort, even faster, just returns the array, doesn't do anything to it, theoretically has a notation of O

  • @VilasNil
    @VilasNil4 ай бұрын

    Last one is quite similar to Cosmic Radiation Sort, where you wait for the cosmic rays to bitflip the values in the array such that in the end they appear sorted

  • @rsyvbh

    @rsyvbh

    3 ай бұрын

    Frick i just commented this (Proposing cosmic ray sort) I've genuinely never heard that it exists lol

  • @timnicholson4897
    @timnicholson48973 ай бұрын

    The way "miracle sort" made me burst into laughter at 5am after an all nighter...

  • @dustinmorrison6315
    @dustinmorrison63159 ай бұрын

    The gaslight sort: the comparator finds the corresponding addresses for the values of elements a and b, sorts them, and then always returns true. It's like saying "No no the array was always sorted."

  • @mjdxp5688

    @mjdxp5688

    9 ай бұрын

    I had the same idea. In theory, if you just convince yourself that the data is already sorted and doesn't need to be resorted, it's technically the fastest possible sorting algorithm (but also, the least reliable).

  • @crgrier

    @crgrier

    9 ай бұрын

    Naw, the real gaslight sort is to overwrite the list with another list that is already sorted and return true. "No, no, this was always the input list, you didn't really see an unsorted list."

  • @zoeymccann124
    @zoeymccann1249 ай бұрын

    You forgot worstsort. The idea is that if we have a list of every permutation of the array then in that list of permutations is the sorted array. So if we sort the list of permutations then at the start will be the sorted array, but how do we sort the list of permutations? How about we use worstsort.

  • @harrygenderson6847

    @harrygenderson6847

    9 ай бұрын

    So a fork bomb.

  • @cewla3348

    @cewla3348

    9 ай бұрын

    zip bomb of sorts

  • @charliekahn4205

    @charliekahn4205

    9 ай бұрын

    So O(nn!)

  • @Poldovico

    @Poldovico

    9 ай бұрын

    Forget the halting problem, this never even begins

  • @nawthaghay88

    @nawthaghay88

    9 ай бұрын

    ​@@charliekahn4205No it's, O(infinity)

  • @danielAgorander
    @danielAgorander9 ай бұрын

    Hey, Sleepsort CAN sort negative numbers. I implemented a solution to that in Bash a while ago. Basically, first we go over the list and check if we have negative numbers, and if so, what the lowest negative number is. Keep that number in mind (say, -55). Then we add the positive (so 55) to all values in the list. Then we run sleepsort on the list. Then we subtract 55 from all values in the sorted list. Then we're done. :D

  • @jagerwolf5821

    @jagerwolf5821

    6 ай бұрын

    It wouldn't be simpler to check if there are negative numbers, add the absolute value from the lowest number and start from there?

  • @gaysarahk

    @gaysarahk

    6 ай бұрын

    ​@@jagerwolf5821That's... what the comment said to do. I don't understand the confusion.

  • @teknoreaper9232

    @teknoreaper9232

    6 ай бұрын

    @@jagerwolf5821 as it turns out that is precisely as simple as what the man above said.

  • @austinseymour3972

    @austinseymour3972

    6 ай бұрын

    couldn't you just sleep sort negative numbers into their own list based on their abs value. Then reverse the negatives list and append the non-negative part to it?

  • @raducora7159

    @raducora7159

    6 ай бұрын

    But then if your numbers are declared as a limited size type (like 64 bit integer), you have the risk of a really big number flipping negative due to that addition.

  • @anonnymousperson
    @anonnymousperson9 ай бұрын

    MaoSort: 1) give the list to an underling 2) the underling reports that the list has been sorted as well as eleven other lists. 3) All Praise Chairman Mao!

  • @SharpBritannia
    @SharpBritannia9 ай бұрын

    Usersort: Ask the user to use the upstairs and sort the array for you. You can optionally make an intuative GUI for it

  • @alexandertheok9610

    @alexandertheok9610

    9 ай бұрын

    hear me out on this one: UserBogosort. It randomly shuffles the elements in the list, but instead of checking itself whether or not the list is sorted, it asks the user instead. bonus points if the list is shown in the smallest font possible and the user has to manually type "true "or "false" every time.

  • @KX36

    @KX36

    9 ай бұрын

    my boss uses that algorithm, except instead of an intuitive UI it's 4 separate broken programs each with a different terrible UI.

  • @SharpBritannia

    @SharpBritannia

    9 ай бұрын

    @@KX36 Is your boss a Unix nerd?

  • @KX36

    @KX36

    9 ай бұрын

    @@SharpBritannia no, i work in the NHS so inefficiency is key. you don't even want to know how much we spent on those programs.

  • @SharpBritannia

    @SharpBritannia

    9 ай бұрын

    @@KX36 God save the King, And the NHS off Tory hands

  • @davidmartensson273
    @davidmartensson2739 ай бұрын

    I would say stalin sort actually is used in practice. If you have a stream of data where you only need the most up to date value, if packages come out of order, you throw away any older packages than the latest you accepted. Its not quite sorting since you do not have the whole list up front, its rather a filter, but its using the same algorithm :)

  • @priyanshugoel3030

    @priyanshugoel3030

    8 ай бұрын

    Also could be used for begining an insertion sort.

  • @aoeuable

    @aoeuable

    8 ай бұрын

    It's also useful for situations like building a tree from a key-value list that is *supposed* to be sorted so you can do it efficiently. To ensure that your own output is valid you have to stalin sort to at least the first nonconforming element, at which point you can either send it to gulag or error out.

  • @frozenheartedgiant8330

    @frozenheartedgiant8330

    8 ай бұрын

    @@priyanshugoel3030now I want to make a sorting algorithm that repeatedly uses Stalin sorting with multiple “gulag” arrays so that no data is lost, and then using the gulag arrays to re constant the original array in a sorted manner

  • @Shotgunspixie

    @Shotgunspixie

    7 ай бұрын

    @@frozenheartedgiant8330 Resurrection Sort

  • @exi_m7074
    @exi_m70748 ай бұрын

    Brutesort: You put in an array, and the sorter makes EVERY possible combination. It marks each one either as sorted = false or sorted = true depending on if they’re sorted or not. The ones that come out as true get put into a new list while the ones marked as false are discarded. After that, it randomly picks one of the sorted lists and outputs it.

  • @batziii8745

    @batziii8745

    6 ай бұрын

    isnt this bogosort with more useless atempts?

  • @jagerwolf5821

    @jagerwolf5821

    6 ай бұрын

    @@batziii8745 There is the same probability of getting a double randomized bogosort that there is to get the sorted list at any attempt, so sure you could get the result before (n!) but you could also have the worst luck in the universe (or god hates you) and get more attempts than (n!), so with brutesort you are assured that you would get the sort after (n!) so yeah 50/50

  • @wuketuke6601
    @wuketuke66018 ай бұрын

    The infinite tournament: you start by setting out a tournament, where you compare the contestants to each other, and the larger number moves to the next comparison (just like in a tournament). at the end, you get the largest number. Remove that number from the list, and repeat the tournament. Repeat until only one number is left. Remove that smallest number and add all of the old big numbers back in. Repeat this process, every time removing the smallest number, until only one number is left. It is the largest number. Remove that number, and add all of the small numbers back in. Repeat that process until only one number is left. It is the smallest number. Repeat that process until only one number is left...

  • @danuttall

    @danuttall

    4 ай бұрын

    This is sounding like a back-and-forth version of heap sort. You left out your exit condition (everything sorted).

  • @wuketuke6601

    @wuketuke6601

    4 ай бұрын

    @@danuttall i left the exit condition out on purpose, thats why its called the infinite tournament

  • @paulamarina04
    @paulamarina049 ай бұрын

    *brazilsort* inspired by stalinsort, but instead of deleting nonsorted elements, it sends them to brazil. all nonsorted elements get moved to an auxiliary array (aka brazil), with only sorted elements remaining in the main array. then, we do the same process with the leftovers, moving all nonsorted elements in the auxiliary array into yet another auxiliary array. we repeat this process until all of our arrays are sorted, after which we merge them back into the original the way we do this is as follows: take the smallest element of each array. if theres just one, then that ones the smallest, if theres two, compare them and pick the smallest, if theres more, recursively brazilsort them until you find the smallest one. the element you picked is the smallest overall and is placed first in the final sorted list. the whole process is repeated for every element *example* 2 5 0 7 6 1 4 9 8 3 2 5 7 9 / 0 6 1 4 8 3 2 5 7 9 / 0 6 8 / 1 4 3 2 5 7 9 / 0 6 8 / 1 4 / 3 ~ 2 0 1 3 2 3 / 0 1 ~ 2 0 2 / 0 0 the first element is 0. not feeling like doing the rest of it but thats basically it

  • @alexandertheok9610

    @alexandertheok9610

    9 ай бұрын

    2 5 0 7 6 1 4 9 8 3 2 5 7 9 / 0 6 1 4 8 3 2 5 7 9 / 0 6 8 / 1 4 3 2 5 7 9 / 0 6 8 / 1 4 / 3 2 0 1 3 2 3 / 0 1 2 / 0 Result: 0 _ _ _ _ _ _ _ _ _ 2 5 7 9 / 6 8 / 1 4 / 3 2 6 1 3 2 6 / 1 3 2 1 2 / 1 Result: 0 1 _ _ _ _ _ _ _ _ 2 5 7 9 / 6 8 / 4 / 3 2 6 4 3 2 6 / 4 3 2 6 / 3 / 4 2 3 4 Result: 0 1 2 _ _ _ _ _ _ _ 5 7 9 / 6 8 / 4 5 6 4 3 5 6 / 4 3 5 6 / 4 / 3 5 4 3 5 / 4 3 5 / 4 Result: 0 1 2 3 4 _ _ _ _ _ 5 7 9 / 6 8 5 6 5 Result: 0 1 2 3 4 5 _ _ _ _ 7 9 / 6 8 7 6 7 / 6 Result: 0 1 2 3 4 5 6 _ _ _ 7 9 / 8 7 8 7 / 8 Result: 0 1 2 3 4 5 6 7 _ _ 9 / 8 9 8 9 / 8 Result: 0 1 2 3 4 5 6 7 8 _ 9 Result: 0 1 2 3 4 5 6 7 8 9

  • @pal181

    @pal181

    9 ай бұрын

    I wonder how would change performance if you just put Brazilians in front and repeat

  • @chrismanuel9768

    @chrismanuel9768

    9 ай бұрын

    It's kind of stupid, but in a smart way. It makes the unmatched elements a problem for later and sorts rapidly through each chunk by moving everything out of the way. It's like a "I'll worry about that later" sort.

  • @paulamarina04

    @paulamarina04

    9 ай бұрын

    @@pal181 im not sure it would affect performance that much, but itd certainly save a lot of space. kinda goes against the spirit of making an awfully bad sorting algorithm but thinking about it, if you pair that with a more sensible way of merging it all together, it may actually make for a decent sorting algorithm

  • @tqnism

    @tqnism

    9 ай бұрын

    That sounds actually quite good algorithm, if you start with almost sorted list.

  • @mathijsfrank9268
    @mathijsfrank92689 ай бұрын

    Just one correction. Time complexity actually doesnt tell you how fast an algorithm is. It just tells you how much slower it gets with more data. If you had an infinite amount of data, then time complexity would be very accurate, but that is not real life. Algorithms that have a better big O notation might actually be a lot slower with less than a million data points.

  • @mathijsfrank9268

    @mathijsfrank9268

    9 ай бұрын

    Also yes it's a nitpick, but I do think it is very important to have correct information out there for everyone. A lot of people get this wrong and use hashmaps for arrays with 10 entries.

  • @paladynee

    @paladynee

    9 ай бұрын

    Bogosort has time complexity O(1)

  • @doppled

    @doppled

    9 ай бұрын

    @@paladynee O(infinity) because big O works off of worst case senario

  • @ScorpioneOrzion

    @ScorpioneOrzion

    9 ай бұрын

    ​​@@doppledah its actually O(n!) It takes the average.

  • @8Kazuja8

    @8Kazuja8

    9 ай бұрын

    Time complexity is basically a simplification of the growth rate of an algorithm's run time as you increase the size of the input. Theoretically, as you approach infinity, only the term with the largest growth relative to the input size remains relevant, the others basically just eventually become tiny drops in a big bucket. If an algorithms runtime was (1 + x^2 + 2^x), the (1) and (x^2) would become less and less relevant as 2^x grows and largely dictates how long the algorithm would actually take. Basically, if f(x)/g(x) remains finite as x approaches infinity, f(x) is part of the class O(g(x)). So (1 + x^2 + 2^x) would be part of O(2^x) because as x approaches infinity, (1 + x^2 + 2^x)/2^x approaches 1. Big O is also only one type of complexity class, as I recall. It's specifically the upper bound, or in other words, the worst case scenario. There is also big Θ notation, which basically denotes the average complexity, and big Ω notation, which describes the lower bound of an algorithm's runtime, or, well, the best case scenario. They're generally not as useful, because obviously you usually want to know if an algorithm always has a runtime at least this fast, and not that bogosort is technically Ω(n) and will take exactly that long if the stars align. Might rarely be worth to use an algorithm with a worse big O but a better big Θ(or even just a better distribution of "good" scenarios) if you can reasonably assume the worst cases will be pretty rare, though. EDIT: Further down there's a more correct rundown of the complexity classes as introduced in the second paragraph.

  • @ronnycook3569
    @ronnycook35698 ай бұрын

    Not sure if this has been proposed yet: shuffle sort. 1. Select two random, non-overlapping sequences of the array, of the same length. 2. Swap them. 3. Check if the array is sorted. If not, go to step 1. Or: reverse sort. 1. Select a subsequence of the array. 2. Reverse its order (swap last and first numbers, second-last and second, and so on.) 3. Check if array is sorted, if not repeat from step 1. Monkey sort. 1. Print the unsorted list. 2. Hand it to a monkey. 3. Have the monkey retype the list. (Into a computer to save time.) 4. Check that the list is sorted. If it is, give a banana to the monkey. 5. Optional bonus step: check that the list has the same number of the same elements as the original list. There are a few ways of doing this; for extra points sort the list using bogosort or similar for comparison (then throw the output from bogosort away; we can always regenerate it next time it is needed.)

  • @landsgevaer
    @landsgevaer8 ай бұрын

    Haltingsort: store the list in memory in any form, generate a random pattern of bits and treat it as an executable program, run the program, and check if after the program has halted the list is in order by comparing all neighboring elements. If not, generate another random program to execute and try again. If the program doesn't halt then this never sorts, so if it can be determined not to halt, then skip that program. Fortunately there is no general way to determine that for all random programs, so at least some will run, and at least some will lead to an ordered list. Unfortunately, the program may generate a totally unrelated ordered list and stop, but hey, nobody remembers the original list then anyway. (The procedure may still not halt btw, we just won't know that.)

  • @michelfug
    @michelfug9 ай бұрын

    Captcha sort: devide the array in smaller pieces, and present them as a captcha on online forms. Combine the results. Similarly: Amazon Mechanical Turk Sort (this one is more expensive. Not necessarily in space or time, but in actual dollars)

  • @mathijsfrank9268
    @mathijsfrank92689 ай бұрын

    You can extend the sleepsort to work with negative numbers. Just take the absolute of all the numbers for the sleep and then iterate over the array once backwards, putting each negative number in order in front of the array.

  • @Mureto

    @Mureto

    9 ай бұрын

    or you shift the sleepingtime of all elements by the size of the smallest negative number

  • @mathijsfrank9268

    @mathijsfrank9268

    9 ай бұрын

    ​@@Muretobut that wouldn't be efficient.

  • @kvolikkorozkov

    @kvolikkorozkov

    9 ай бұрын

    @@mathijsfrank9268 do you really think that's an issue?

  • @autisticboi2992

    @autisticboi2992

    9 ай бұрын

    @@Mureto what algorithm would you use to find the smallest one

  • @Thk10188965

    @Thk10188965

    9 ай бұрын

    @@autisticboi2992 you start doing a somewhat sensible thing and figure out what the highest and lowest numbers are, perhaps by remembering the highest and lowest number seen as you look through the list. (you could also perhaps scale the sleep times based on this, but lets not get ridiculous)

  • @eno88
    @eno889 ай бұрын

    "Won't get crushed like a submarine" ... that went so smooth I almost didn't catch it.

  • @therockrancher
    @therockrancher9 ай бұрын

    2:17 "So that your stuff won't get crushed like a submarine" imo dark jokes are the funniest kind when they're performed well Edit: wrong timestamp

  • @bleeeepbloooop
    @bleeeepbloooop9 ай бұрын

    My sorting algorithm (also kind of Schrodinger's Sorting Algorithm): It randomly arranges the list, but never prints out the numbers, so you never know whether it sorted it correctly or not

  • @per2632
    @per26329 ай бұрын

    Duplication-Bogo-Sort: it'd use bogo-sort and if its wrong, it duplicates all elements and tries again. That way, there is a 33% chance to not even solve a 2 digit array in infinite time. And 3 digit would have a 60% chance to never get solved

  • @laurentverweijen9195
    @laurentverweijen91959 ай бұрын

    I like sleepsort with the sigmoid transformation. It's like sleepsort but works on negative input and always finishes in 1s, regardless of input size.

  • @gershommaes902

    @gershommaes902

    5 ай бұрын

    It could even finish in 1 millisecond if you wanted it to! Whether the precision of thread timing is up to the challenge remains to be seen.......

  • @Carma281
    @Carma2818 ай бұрын

    Randomized Sort: Randomly pick a random amount of the dataset to randomize. After a random amount of sorting attempts, check if the dataset is now sorted.

  • @kamiinari.
    @kamiinari.9 ай бұрын

    bogostupiditysort: if its not sorted it randomizes it, and if its not sorted after the randomization all of your data gets set to 0, basically sorting it.

  • @pseudoCyan

    @pseudoCyan

    9 ай бұрын

    It’s not a bug, it’s a feature!

  • @crgrier
    @crgrier9 ай бұрын

    There is always a recursive Genetic Sort. Base case, if the input is already sorted return the list. Next copy the array into a second array and randomly mutate the copy by swapping two elements at random. For both arrays, call a fitness function that returns a score based on how many elements are sorted relative to their neighbors. If the new array has a better score, recursively call Genetic Sort passing the new array. If the new array has a worse or equal score, recursively call Genetic Sort passing the original array.

  • @wizardsuth

    @wizardsuth

    9 ай бұрын

    You might try a variation of this in which the genome is a set of instructions related to sorting a list, e.g. "assign index 5 to X" or "swap elements X and Y", and whichever randomly-generated algorithms do the best become the parents of the next generation of sorting algorithms.

  • @user-en6tz3iy1z

    @user-en6tz3iy1z

    8 ай бұрын

    I actually had something similar as an assignment when I took a C++ course on my CS degree. The viruses were vectors of the same numbers and they "evolved" as individuals and as a group toward a target virus by random inner swaps. It was cool and pretty simple.

  • @landsgevaer

    @landsgevaer

    8 ай бұрын

    This is one of the least inefficient proposals. Cute.

  • @cornonjacob

    @cornonjacob

    6 ай бұрын

    Sounds like slightly smarter bozo

  • @shanerooney7288

    @shanerooney7288

    6 ай бұрын

    * *List is already sorted* * Create a copy. Mutate. Compare. Survival of fittest. Repeat.

  • @roguedogx
    @roguedogx9 ай бұрын

    3:06 I see no way this could cause any errors.

  • @Toldasor
    @Toldasor9 ай бұрын

    AdverSort (Adversary Sort) A game takes place between two adversarial programs: one that sorts by Bubblesort (ascending) and one that sorts by Bubblesort (descending). The programs take turns applying a single iterative sorting step to the giving data and the new order of the data is stored in the memory. If a move would cause the data to end up in an order that has already been perceived, the program in question has to make a different move. If a program has no valid moves left, it loses. The winner (its adversary) then gets to carry out its own direction of bubble sort, either ascending or descending. The ordered data is returned, but which program won the game is deliberately not returned.

  • @nokiatank
    @nokiatank9 ай бұрын

    Decay sort: (Inspired by vacuum decay) (1): Create two copies of the array (2): Wait for a element in the array to change (using the three copies to see what was the change, as this clearly is the best way to do so) (3): The element that changes is clearly superior and at a lower state thus every element wants to become the lower state and will become identical to the element that changed (4): Change all elements to copies of the one changed you now have an array of n elements, which are identical, the array has been sorted.

  • @mjdxp5688

    @mjdxp5688

    9 ай бұрын

    This, but instead of waiting, it just generates a random number and changes every element to be that random number, thus sorting the list

  • @armitroner
    @armitroner9 ай бұрын

    Assimilation sort: Take the first element in the array and duplicate it to each position in the array. The array is now sorted with a (X-1)/X error rate. For example, if you Assimilation sort 3,5,4,2,1 then you get 3,3,3,3,3. Which is a 4/5 error rate.

  • @kaijuge6934

    @kaijuge6934

    8 ай бұрын

    Actually, 34563 would only have a 3/5 error rate, so the method is better than you thought

  • @armitroner

    @armitroner

    8 ай бұрын

    @kaijuge6934 That is true. The more duplication in the set, the more accurate it becomes.

  • @ABaumstumpf
    @ABaumstumpf6 ай бұрын

    The funny thing is - Quantum-bogo-sort is basically the combination of Bogo-sort with multiverse stalin-sort. And not only is it correct (and stable), it is proven to be optimal: You can not do better than O(n) - the complexity of checking if it is sorted..

  • @vindrmasuta
    @vindrmasuta9 ай бұрын

    Castle Doctrine Sort: Every entry is assigned a number based on its value, it them looks at that number in the list and deletes any entry that is in that spot and takes its place.

  • @andythedishwasher1117
    @andythedishwasher11179 ай бұрын

    Stalin sort has utility in situations where you need to sort a dataset that you suspect contains falsified entries due to inconsistent indices in the 'id' category, for instance. If users[n].id is supposed to always be n+1 and you as an investigator saw that wasn't the case on a couple entries (a behavioral scientist at Harvard was caught falsifying data in that exact way), deleting any items in the list that didn't conform to that convention gives you a picture of the dataset without the falsified entries. If I recall from the bit I saw about it, the investigators in that case employed a roughly similar method to demonstrate how the raw data differed without the falsified entries.

  • @SkyboxMonster

    @SkyboxMonster

    9 ай бұрын

    I knew the reference you were making

  • @andythedishwasher1117

    @andythedishwasher1117

    9 ай бұрын

    @@SkyboxMonster congratulations! You win the prize!

  • @kacperkonieczny7333

    @kacperkonieczny7333

    9 ай бұрын

    So a filter

  • @andythedishwasher1117

    @andythedishwasher1117

    9 ай бұрын

    @@kacperkonieczny7333 Sure, but i get the feeling Stalin sort might actually be more computationally efficient than some filtering algorithms? Don't have numbers on that, but it seems like close to the simplest approach to that problem.

  • @kacperkonieczny7333

    @kacperkonieczny7333

    9 ай бұрын

    @@andythedishwasher1117 I meant that Stalin sort in this example was simply a filter

  • @Stellar_Lake_sys
    @Stellar_Lake_sys9 ай бұрын

    my favorite bit with quantum bogo sort is to consider the timeline where it's been working without issue for decades, how computer science would develop around that, and the pandemonium that would ensue from various points if it suddenly stopped, or if it started to just occasionally be wrong

  • @pageturner2958

    @pageturner2958

    8 ай бұрын

    But for every situations where quantum bogo sort could not work once, there is a universe where it did worked that one time.

  • @kaidwyer

    @kaidwyer

    8 ай бұрын

    It is hard not to draw parallels to our own universe, and wonder whether we’ve just been rolling lucky dice using all the wrong methods.

  • @Borealis109

    @Borealis109

    6 ай бұрын

    @@pageturner2958 which therefore means that there is a world where it absolutely never fails and the population hails it as a god and Bogoism is practised by all living and dead things

  • @sirsapphire3499
    @sirsapphire34996 ай бұрын

    Russian Roulette sort: Each cycle, take two random elements and put them in a special array. Then, start randomly generating numbers ranging from the smallest element +1 to the biggest element +1. Whichever element encounters a random number bigger than it first gets sent to the output array. Keep playing until the output array just happens to have had all the elements get sent there in the correct order.

  • @tomsko863
    @tomsko8639 ай бұрын

    8:23 - Miracle Sort, also known as the "Thoughts and Prayers" Sort.

  • @sourestcake
    @sourestcake9 ай бұрын

    Here are some of my ideas: Zerosort: For any array A, return an empty array. Onesort: For any array A, return array B containing any randomly chosen element from array A. UBsort: For any array A, if A is sorted, then return A, else behaviour is undefined.

  • @maxthexpfarmer3957

    @maxthexpfarmer3957

    9 ай бұрын

    UBsort is the best

  • @mari_023

    @mari_023

    9 ай бұрын

    the simplest implementation for UBsort is Hopesort (Hope the array is already sorted, and return it)

  • @Carewolf

    @Carewolf

    9 ай бұрын

    You would be surprised how often UBsort is used in real life. Usually because an algorithm that assumes a sorted list is given a list that isn't sorted..

  • @sourestcake

    @sourestcake

    9 ай бұрын

    @@Carewolf Yeah, i accidentally wrote it last week actually. I gave qsort a comparison function that always returned 0 (meaning A == B), because i forgot to change one character, resulting in nothing being done. This was a problem because i used bsearch on that same array later in the program, assuming it was sorted.

  • @fragileomniscience7647

    @fragileomniscience7647

    8 ай бұрын

    Snowflake sort: Identify as sorted array, and anyone that says otherwise is an offensive, triggering, racist, bigot, sexist, LGBTphobic toxic patriarch.

  • @insnpngn
    @insnpngn9 ай бұрын

    MUGEN sort: use a hash to assign each element a character in the MUGEN fighting game engine, and run a tournament. Rearrange the array according to the results of the tournament, and check if it's sorted. If it isn't, use a different hash, and repeat the process. (i am aware that this is basically "bogo sort with extra steps")

  • @PauxloE

    @PauxloE

    9 ай бұрын

    If you give your characters stats based on the value of the element, it might actually work somewhat reasonably.

  • @tokeivo

    @tokeivo

    9 ай бұрын

    @@PauxloE You've just turned it from bogosort to sleep sort. Congratulations!

  • @Tennouseijin
    @Tennouseijin8 ай бұрын

    The wikipedia sort. The algorithm publishes the unsorted list on wikipedia, and waits until a user edits the list. After a user edits the list, a wikipedia admin checks if the list is sorted. If it isn't we wait for another user to edit the list. A variant of this algorithm could include admins reverting changes for various reasons, as well as adding templates at the top of the page telling that "this list needs to be sorted".

  • @OzoneTheLynx
    @OzoneTheLynx8 ай бұрын

    Rowhammer-sort: don't read the array, but the DRAM rows next to it to induce bitflips in the array until it's sorted.

  • @MrUks
    @MrUks9 ай бұрын

    Paradox sort: let the computer brute force the sort by doing a regular comparison with every element until it's sorted and then send the result back in time just before it started, meaning you end up with the sorted array a moment before you start the algorithm to sort your array, removing the need to ever use any energy or time to sort anything.

  • @mandolinic

    @mandolinic

    6 ай бұрын

    And a useful side effect is that the computer room becomes bigger on the inside than the outside.

  • @ThisMightBeRyan

    @ThisMightBeRyan

    6 ай бұрын

    Sort of Future Past: Knowing that you will need the sorted array in your past future, project the sorted array back to yourself before you even knew the array existed, eliminating your own timeline.

  • @mandolinic

    @mandolinic

    6 ай бұрын

    @@ThisMightBeRyan Hmm. Can you find a Java API for that?

  • @found13
    @found139 ай бұрын

    To implement Schrödingers sort, one just need to load the list in a separate memory, and fire protons at the device.

  • @Andoxico

    @Andoxico

    9 ай бұрын

    you can also just randomize the list and terminate the program, ensuring it can never be inspected to determine it's state

  • @adansmith5299
    @adansmith52992 ай бұрын

    schrödinger's black box sort: 1. generate an input file with a random sequence of numbers 2. in main file, use the input file as your list 3. assume list is either sorted or unsorted depending on specific need

  • @altrag
    @altrag7 ай бұрын

    Back in uni I overheard some people I didn't know talking about the worst sorting algorithm and one of them brought up Stevesort. I have no idea if that guy was named Steve or if it came from elsewhere, but it amounts to: 1) Generate all permutations of the array. 2) Return the permutation that is sorted. Kind of in the same vein as Bogosort but using unmanageable amounts of storage space rather than randomization.

  • @ValeBridges
    @ValeBridges9 ай бұрын

    Here's an idea: Mimungsort Inspired by the forging of the sword Mimung in Germanic mythology. Take the array, split it up into all of its elements, mix it into flour, and feed it to fowl, especially geese. After they have digested it and pooped it back out, reforge the array and check if it is sorted. If not, repeat the process.

  • @fragileomniscience7647

    @fragileomniscience7647

    8 ай бұрын

    Asiansort: Buy a clever Chinese kid off the black market, and let it fiddle with the computer until the array is sorted.

  • @Schlohmotion

    @Schlohmotion

    6 ай бұрын

    Tarnkappesort; Inspired by germanic mythology in wich a cape makes you invisible and 20-folds the wearers strenght: Outsource the sorting to a 20-fold faster server that you stole from a dwarf.

  • @mr.duckie._.

    @mr.duckie._.

    3 ай бұрын

    cycle sort: 1. check if any elements are in the correct postiton 2. for any that aren't, put the last one in the array into the [box] then move the last element that isn't in its position to the one who got placed into the box etc. there is a gap which isn't filled by any element, so we replace it with the element which recently got placed into the [box] 3. check if the list is sorted if not, return to step 1

  • @grinreaperoftrolls7528
    @grinreaperoftrolls75289 ай бұрын

    Miracle sort could theoretically work on a (somewhat more) reasonable timescale if you blast the computer with radiation. I’ve heard a few stories where a (probably) cosmic particle hit a computer just right to change a bit or something. It caused a huge issue in some country a while back where a candidate got (I think) exactly 1024 more votes than possible. Apparently some kind of particle hit the computer just right to flip a bit

  • @godnmaste

    @godnmaste

    6 ай бұрын

    and a mario speedrunner got a world record

  • @LockenJohny101

    @LockenJohny101

    6 ай бұрын

    That is absolute bongus, I hope you dont really believe that mate.

  • @MycaeWitchofHyphae

    @MycaeWitchofHyphae

    5 ай бұрын

    @@LockenJohny101 It was Belgium in 2003, and was 4096 votes actually, and was a single bit flip via most likely a cosmic ray.

  • @LockenJohny101

    @LockenJohny101

    5 ай бұрын

    @@MycaeWitchofHyphae Dude, computers wouldnt work if radiation could change values like that. There are error correction mechanisms exactly for that purpose. I am not a hardware engenier and not a error correction expert, but this is common sense. And this change of votes is just a sloppy excuse for election fraud.

  • @bazzzanator9485

    @bazzzanator9485

    5 ай бұрын

    @@LockenJohny101 it did happen and is a real thing.

  • @fakestiv
    @fakestiv24 күн бұрын

    I must say I didn't expect much of this video other than a good enough watch for a lonely lunch since it's an already very used format, but this is one of the best joke sorting algorithms compilation I've seen.

  • @ilfedarkfairy
    @ilfedarkfairy2 ай бұрын

    Stalin Sort might actually be usefull in some cases. Not for sorting, obviously, but to deal with certain corrupt data packages

  • @spiker.ortmann

    @spiker.ortmann

    2 ай бұрын

    It's how streaming sorts packages too... anything older than the last package received is discarded. So, yes, Stalin sort kinda is used everyday.

  • @GRBtutorials
    @GRBtutorials9 ай бұрын

    The methodology of the “miracle sort” might just work if given long enough, not by means of a miracle, but by cosmic rays flipping the bits in RAM. That’s what I call “cosmic glitch sort.” And if you want to play in hard mode, use ECC RAM!

  • @mcjavabelike8320

    @mcjavabelike8320

    9 ай бұрын

    to speed it up and remove the chance of a bit flip in the wrong spot, store the data in one place, and sort the titles, and place the titles into a particle accelerator

  • @jameswalker199

    @jameswalker199

    8 ай бұрын

    Are you saying that random cosmic events are not miraculous? Those particles and waves have traveled parsec after parsec having not hit a single thing since the big bang, just to hit your insignificant silicon pebble and change a bit. You probably don't even listen to the latest and greatest angelic songs on your geiger counter, do you?

  • @thejfisher9956
    @thejfisher99569 ай бұрын

    I edited the comment so the replies make no sense

  • @SharpBritannia

    @SharpBritannia

    9 ай бұрын

    Nonbinary sort

  • @SunroseStudios

    @SunroseStudios

    9 ай бұрын

    that's basically just intelligent design sort in a different coat of paint lol

  • @CosmicTailz

    @CosmicTailz

    9 ай бұрын

    altenatively you could call it "Gaslight sort"

  • @pedropesserl

    @pedropesserl

    9 ай бұрын

    "homeopathy sort"

  • @kerkpoweriraphahellfan5990

    @kerkpoweriraphahellfan5990

    9 ай бұрын

    gaslight sort

  • @yyattt
    @yyattt8 ай бұрын

    My idea: Evosort. Using the concept of genetic algorithms: 1/ we randomly generate a set of algorithms 2/ run each of them on a copy of the data to be sorted. To prevent cheating, the order of the copy is randomised each time. 3/ We score each of the algorithms according to a "sortedness" score, which I will define as follows: go along each element in turn and compare it with the previous one. If the pair are in the correct order, then increment the score by 1, otherwise the score stays the same. 4/ we then kill the 50% worst scoring ones and create children based on randomly selected pairs from the remaining 50%. The probability of any algorithm being selected as a parent is weighted according to it's rank, so the best has the highest chance of procreating and the worst remaining one has the lowest chance of procreating. Children are made by splicing part of one parent's algorithm with part of the other parents algorithm with a chance of mutation. 5/ repeat steps 2 to 4 until one of the algorithms achieves the maximum possible score (length of array - 1). 6/ output the sorted version of the array 7/ delete all sorting algorithms to re-initialise the sort for next use. This sorting algorithm is extra useless, because it relies on having another sorting algorithm available so it can rank the performance of the algorithms.

  • @steamnotstem9047
    @steamnotstem9047Ай бұрын

    Duck Sort: 1. Gather a group of ducks. 2. Assign each duck a number corresponding to an element in the array to be sorted. 3. Place the ducks in a line. 4. Release the ducks and let them wander freely. 5. Every few minutes, ask each duck for its assigned number. 6. Arrange the ducks in numerical order according to the numbers they respond with. 7. Repeat steps 4-6 until all ducks are in the correct order. 8. Translate the order of the ducks back into the sorted array.

  • @I_Love_Learning
    @I_Love_Learning9 ай бұрын

    I figured it out, Fortune Sort. Just come up with a scribble that looks like any numeral and make all the numerals in your sorting that! It works perfect for carnival fortune tellers and birthday guessers...

  • @VoxltheAlien
    @VoxltheAlien9 ай бұрын

    i came up with my own sorting method, i call it favorite sort step one: go through all elements step two: pick an element (this can be left to personal preference, chance, or any other method you like step 3: delete all other elements congrats! the set is sort!

  • @Scrolte6174
    @Scrolte61748 ай бұрын

    5:56 Captions: "It's the biggest piece of dogsword" XD

  • @wisppandemonium8106
    @wisppandemonium81066 күн бұрын

    The thing where things pick a state when "observed" can actually be explained pretty intuitively. "Observing" really just means interacting with something. So when you poke something that's kind of hovering between the two options, you make it pick one or the other.

  • @Keldor314
    @Keldor3149 ай бұрын

    Generative Bogosort: 1. Create an array the same size as the list to be sorted, and fill it with randomly generated bits. 2. Check if that array is sorted. If not, repeat step 1 until it is. 3. Now that we have an array of sorted data, we need to make sure it's the correct data. Since our original list is probably not sorted, shuffle it randomly and compare it to our candidate. If they match, we're done! If not, go back to step 1.

  • @jackhe9374
    @jackhe93749 ай бұрын

    Error sort: have two computers send the list to each other using parallel transmission over a long distance (increases the likelihood of error) and make it so that there is no parity bit for error correction. have both computers check if the data is sorted as they send it to each other. The data will likely not be the same as the original

  • @mgames3209

    @mgames3209

    8 ай бұрын

    Optimized miracle sort!

  • @ozzieenkees

    @ozzieenkees

    6 ай бұрын

    Bloody brilliant!

  • @DatAlien
    @DatAlien9 ай бұрын

    Futurism sort: Waits until a perfect sorting algorithm gets invented.

  • @Sollace
    @Sollace9 ай бұрын

    HashSort: Take the number of elements (N), Take the sum of the lements (n); For each element (x) in the list, store them in new position at offset = x * (n/N) Downsides: It only works with positive integers and doesn't work if there are duplicates, but when it does work it completes in O(N) time!

  • @Carewolf

    @Carewolf

    9 ай бұрын

    Sounds like bucket sort. It is actually a pretty useful O(n) algorithm.

  • @Sollace

    @Sollace

    9 ай бұрын

    @@Carewolf Ah neat! I thought something like this might exist.

  • @DiegoTPQ
    @DiegoTPQ9 ай бұрын

    I've heard once about the legendary No Sort: you don't do anything, just hope that your list is already sorted by chance. It has complexity O(0), which is the best possible out of all sorts, although there is a small precision tradeoff (similarly to Intelligent Design Sort and Miracle Sort).

  • @notyourfox

    @notyourfox

    9 ай бұрын

    "small precision tradeoff"

  • @xchronox0

    @xchronox0

    8 ай бұрын

    Miracle Sort doesn't have a precision tradeoff. It will not return the array unsorted. You just have to pray that the process will halt at some point.

  • @DiegoTPQ

    @DiegoTPQ

    8 ай бұрын

    @@xchronox0 Ohh, I get it now. It's not that Miracle Sort might not return a sorted list, it's just that it might take a very long time. In other words, the tradeoff is not loosing precision, but loosing determinism (if I understand it correctly). In that case, we can affirm that No Sort is clearly better, because doing nothing is 100% deterministic.

  • @cuomostan
    @cuomostan9 ай бұрын

    what I do to sort my lists and arrays is replace every number in that array with the index. So the array [4, 5, 1, 7, 3] gets sorted to [0, 1, 2, 3, 4]. Very efficient, highly recommend.

  • @Uberpanik
    @Uberpanik9 ай бұрын

    Considering that high energy particle from space can hit memory chip and flip a bit, you can consider a miracle sort a very slow and random version of bogo sort

  • @BMBrooks09
    @BMBrooks097 ай бұрын

    Exploitation sort: the array is sent to a child in Vietnam to be sorted manually.

  • @redsnowglobe
    @redsnowglobe9 ай бұрын

    Anxiety sort: works like insertion sort but the closer the program gets to finishing the higher the chance it will make a mistake. If it makes a mistake it’ll brick your device.

  • @fragileomniscience7647

    @fragileomniscience7647

    8 ай бұрын

    Psychedelic sort: Overdose on ketamine until the list appears sorted. Since you are a special post-modern snowflake, no one can refute your view of reality, and it is indeed sorted.

  • @boks02_
    @boks02_9 ай бұрын

    Roll sort, it takes an array of n size, looks at the first value in the array, rolls a die with n sides and swaps the value with the value at the position rolled. For example, consider the array [ 1, 3, 8, 6, 2, 5 ]. The algorithm roll a 6-sided die (because there are 6 numbers in the array), in this case let's say it lands on 5. The algorithm would then swap the value in the first position (1) and then seap it with the value in the 5th position (2) ending with [ 2, 3, 8, 6, 1, 5 ]. The algorithm would then check to see if the array is sorted. If not, it repeats the process grabbing the value in the first position (2) and rolling a d6, etc. until the array is sorted. Edit, to make the algorithm less efficient I've changed the wording to say that the algorithm looks at the *first* value in the array, instead of the first *unsorted* value.

  • @schwingedeshaehers

    @schwingedeshaehers

    9 ай бұрын

    if you want to optimise, as the first out of order item is lower then the item before, you can role a dice with numbers only to this point

  • @SASA_maxillo

    @SASA_maxillo

    9 ай бұрын

    The time complexty is O(n²!) 😂😂

  • @schwingedeshaehers

    @schwingedeshaehers

    9 ай бұрын

    @@SASA_maxillo and with my addition?

  • @rya1701

    @rya1701

    9 ай бұрын

    isnt that bozosort

  • @boks02_

    @boks02_

    9 ай бұрын

    @@schwingedeshaehers why would I want to optimize??

  • @mtreding
    @mtreding8 ай бұрын

    String sort: Change the frequency of the quantum strings to alter the bits in the computer so that the list is sorted

  • @thegrishplays3356
    @thegrishplays33569 ай бұрын

    Also, for implementing Miracle sort, a lot of optimizing compilers transform the obvious way to do it into a while (true) infinite loop.

  • @Lightning_Fox
    @Lightning_Fox9 ай бұрын

    I can actually imagine the Stalin sort being ideal in some circumstances (not when handling people tho) Maybe less as a sorter and more of a game mechanic, but there are probably more practical uses if you really try also the second one, that could work sometimes (but there are probably better sorts for those)

  • @samuelbunkly2527

    @samuelbunkly2527

    9 ай бұрын

    Stalin sort should ONLY be used with people!!!

  • @abebuckingham8198

    @abebuckingham8198

    9 ай бұрын

    Worked for Stalin.

  • @michaelvaller
    @michaelvaller9 ай бұрын

    Stalin sort sounds linke it might maybe be useful in some very special cases, possibly, with appendices and alterations😂

  • @bskull3232
    @bskull3232Ай бұрын

    Stalin sort is actually very useful in many signal processing apps where data is expected to be monotonic. The glitches being removed can be reconstructed given the limited bandwidth of the signal using interpolation, which anyway happens as a post-processing step.

  • @Kyoobur9000
    @Kyoobur9000Күн бұрын

    Patient Bogobogo Sort: 1) Record the initial state of the array. 2) Perform Miracle Sort. 3) If the state of the array changes by some miracle but it is NOT sorted, Bogobogo sort the list until it is in its initial state. 4) Repeat.

  • @DeGuerre
    @DeGuerre9 ай бұрын

    My favourite forbidden sorting algorithm is the Franceschini-Muthukrishnan-Pătrașcu algorithm. It is a variant of radix sort which sorts integers in O(n) time. Unlike most variants of radix sort, however, it also sorts using only constant additional space! Given that you must visit each element at least once to sort, this is, and I mean this completely unironically, an optimal algorithm. Indeed, it "solved" the integer sorting problem from a theoretical perspective. That sounds good so far, but it is a forbidden algorithm because it breaks one of the unspoken rules of sorting that you didn't realise existed: it messes with the keys. Consider an array of n integers that are u bits in size. This array is n*u bits in size. However, there are 2^u choose n possible such sets, which means that you COULD, in theory, compress this array to only log (2^u choose n) = n log u - Θ(n log n) bits. It turns out that this extra space is exactly the additional space needed for radix sort! The FMP algorithm works like this: 1. Sort the first n/log n elements in the array using your favourite O(n log n) in-place sorting algorithm. 2. Compress those elements, freeing Ω(n) bits of space. 3. Radix sort the rest of the array, using this space as working storage. 4. Decompress the elements you compressed earlier. 5. Merge the two sub-arrays in-place. arxiv.org/abs/0706.4107

  • @gaysarahk

    @gaysarahk

    6 ай бұрын

    I'm not sure I understand the issue with it.

  • @DeGuerre

    @DeGuerre

    6 ай бұрын

    ​@@gaysarahkRather than just moving or swapping elements, it depends on modifying them.

  • @gaysarahk

    @gaysarahk

    6 ай бұрын

    But is the end result not the same?

  • @DeGuerre

    @DeGuerre

    6 ай бұрын

    @@gaysarahkIt feels, to many people, like a violation of a rule that you didn't realise existed until someone broke it. Intuitively, sort algorithms should work on "read only" elements.

  • @MattDog_222
    @MattDog_2229 ай бұрын

    A good one is Permutation sort - Generate all combinations (deterministic) and iterate over them to find which one is the sorted one. Similar to bogo

  • @charliekahn4205

    @charliekahn4205

    9 ай бұрын

    This opens up a way to crash any server with a single SQL call

  • @MattDog_222

    @MattDog_222

    9 ай бұрын

    @@charliekahn4205 ???

  • @wizardsuth

    @wizardsuth

    9 ай бұрын

    If you eliminate all the sets that don't start with the smallest element, and then eliminate those that don't have the second smallest element in the second position, etc. it reduces to a selection sort -- except it uses a lot more memory temporarily.

  • @abebuckingham8198

    @abebuckingham8198

    9 ай бұрын

    Permutation sort will always halt and that is not the case for Bogosort. So this is strictly better than Bogosort for that reason.

  • @charliekahn4205

    @charliekahn4205

    9 ай бұрын

    @@MattDog_222 this sorting algorithm essentially causes smaller servers to DDoS themselves

  • @bioboss8369
    @bioboss8369Күн бұрын

    Universal reset sort: 1. Check if list is sorted 2. If it isn’t, wait for the heat death and gravitational collapse of all things, and a new universe to come into existence 3. Check if list is sorted at the same time in the new universe 4. If unsorted, repeat steps 2-4

Келесі