Found Snorlax Sort on Reddit, never head of it before, apparently 0(1) complexity for unlimited inputs. I don't know much about coding, but can someone explain how this works? Search Snorlax Sort on GitHub
So I read the read me and it sounds like that to get this O(1) there is a downside where it doesn't work 100% of the time. So couldn't you just run it several times? O(1) beats everything we have right now (as far as I understand) so even with this drawback it sounds like it would be really good?
this is a joke right?public int[] sort(int[] snorlax) {
return snorlax;
}
>>52087433
I don't know Java but doesn't that just return the input ?
>>52087463
no shit.
this is just a dumb ass joke.
hell I might send a pull request to make it Generic just for keks.
>>52087480
So it is the most efficient sorting algorithm ever but it only works on certain inputs? Genius.
>>52087480
Make it Generic, this is so stupid it just might become a thing
>>52087268
The more I read, the stupider it gets
There is actually an algorithm called soft heaps that will only semi-sort numbers. It has been used to get the best minimum spanning tree algorithm.
>https://github.com/CMMCD/Snorlax/blob/master/SnorlaxJava/snorlax.java
It's a joke, how'd you not realize this?
It's O(1) because it just returns the array, and of course it works if the input is already sorted.
The likelyhood of a sorted output is 1/n!, where n is the length if the input./** Snorlax is an advanced sorting algorithm with extremely high efficiency.
* Note that this high efficiency comes with certain accuracy drawbacks outlined in the readme.
*
* @author github.com/CMMCD/
* @version 1.3
*/
public class snorlax {
// Your Snorlax's name.
private String name;
/** Class constructor.
*
* @param name What you choose to name your Snorlax.
*/
public snorlax(String name){
this.name = name;
}
/** Snorlax's sorting algorithm.
*
* @param snorlax Integer Array passed to Snorlax for sorting.
* @return The usualy* sorted input. *See readme for more information*
*/
public int[] sort(int[] snorlax) {
return snorlax;
}
/** Snorlax's sorting algorithm, with output instead of return.
* Note that the output is usualy* the sorted input. *See readme for more information*
*
* @param snorlax Integer Array passed to Snorlax for sorting.
*/
public void snorlaxSort(int[] snorlax) {
int[] snorlaxSorted = sort(snorlax);
System.out.println("Greetings, I am " + name + "! Here is your sorted array, enjoy!");
String snorlaxSpeak = "";
for (int zzz : snorlaxSorted) snorlaxSpeak += zzz + " ";
System.out.println(snorlaxSpeak);
}
}
>>52088462
Is it more efficient than Snorlax sort?
>>52088554
So it's the most efficient sorting alg ever made but has a chance to fail on some inputs?
Pretty troll
So did anyone ever figure out the complexity of sleep sort?
>>52088643
O(size of largest input) I guess
>>52088554
Code is surprisingly clean and well documented for something so stupid