Pancake sorting problem
Explain to me why my solution isn't o(nlogn) given that flipping the tray costs o(1)
>>8622066
flip and resize your picture
check some usual sorting algorithms and see where they are different from yours
count the number of operations yourself and see where there might be problems
do your homework by yourself
>>8622066
>taking a picture of a computer screen
just kill yourself
>>8622078
Yeah that's pretty retarded sorry
>>8622074
This isn't my homework nor was I told I'm wrong
Wikipedia says it's unsolved and I think mine pretty much nails it
>Prove me wrong
>>8622066
>there are CS majors who don't understand how to take a screencap
>>8622096
Come on, I'm not a CS major and I wanted to send it over WhatsApp and I don't have WhatsApp web.
Can we focus on the maths?
>>8622108
Not with a picture like that, no.
This is O(n^2) because at most, it would have to flip each and every single fucking pancake once. (Flip operation n times, and then flip itself traverses the array n times)
Just post the whole code online, maybe someone can help
>>8622087
You need to run not walk to student admin and change majors to Gender Studies / Sociology.
Given that these subjects don't require you to actually learn any actual skill, you may have a chance.
>>8622066
find_between is o(n)
>>8622140
Sorry, didn't see the "flip is o(1)" part.
As somebody else mentioned, find_between() is o(n).
Worst case:
This happens n times
Boom! O(n^2)