4 ms·
If your workplace ever has a big pizza lunch, take a few boxes and just walk somewhere else to open them. Turn an O(n) problem into O(1) with just a few people
by jzwinck 7y ago
If your workplace ever has a big pizza lunch, take a few boxes and just walk somewhere else to open them. Turn an O(n) problem into O(1) with just a few people helping.
- sokoloff 7y agoWhen all pizzas are the same (or maybe of two types), that works. When there are 10+ different types of pizzas ordered, this algorithm turns it into a likely worse search problem.
- SamBam 7y ago...so if there are x tables, each with y different pizzas, unknown to you at the start, and you have a mental algorithm that assigns each pizzas a score between 0 and 1, how many tables do you need to visit before you are confident you are selecting a pizza that is in the 90th percentile of available pizzas, if we assume you're not allowed to return to a table after dismissing it..?
- Aeolun 7y agoI do think that’s mathematically interesting, but practically I think you can just take pizza from the first table since all pizza is good.
- LanceH 7y agoIt doesn't matter because the pepperoni is already gone and all that is left is the three vegan pizzas for the two one hundred pound members of the team.