SpongeBob has just finished making n Krabby patties. Whenever a Krabby patty is finished he just throws it into the pile regardless of it's size. However, Mr Krab just gave an order saying that patties should be brought to the customers in descending order !
The patties are too hot for SpongeBob's hands to touch so the way he sorts them is by putting his spatula somewhere in the pile , thus diving it to two smaller piles , and flips the upper pile upside down.
What would be the most efficient way to sort n patties and what would be the efficiency?
Well since n = 1 we don't need to worry about efficiency.
The most efficient choice would be to make a food that required less steps in preparation.
I found a solution for worsr case O (2n-1), can you guys do the same?
>>51270550
Please don't shill your burger house here on /g/ thanks.
>>51270550
This problem is NP hard.
Is this from that fucking SAT book with the Kim Kardashian Ass and shit?
>>51270620
No it isn't
>>51270628
No anon , that's actually a well known math riddle , I just presented it humorously
>>51270629
Yes it is.
>>51270629
http://www.sciencedirect.com/science/article/pii/S0022000015000124?via%3Dihub
>>51270686
You're right . I'm sorry I wasn't sure about what np hard is
>>51270550
Just use a fucking mergesort Spongebob
>>51271598
>memesort
or just quicksort