[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

Pancake sorting problem Explain to me why my solution isn't

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 12
Thread images: 3

File: IMG-20170121-WA0010.jpg (2MB, 2368x4208px) Image search: [Google]
IMG-20170121-WA0010.jpg
2MB, 2368x4208px
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
>>
File: 1112481.jpg (59KB, 500x539px) Image search: [Google]
1112481.jpg
59KB, 500x539px
>>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
>>
File: shit_code.jpg (2MB, 4208x2368px) Image search: [Google]
shit_code.jpg
2MB, 4208x2368px
>>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)
Thread posts: 12
Thread images: 3


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.