Comment by SyzygyRhythm
3 hours ago
Do you have any more detail on this? When I first saw the 3SUM result, it was accompanied with a comment something like "There is the obvious O(n^3) algorithm, and a pretty easy O(n^2) algorithm". I thought for about 15 seconds and came up with: put all the numbers in a hash table (O(n)). Search every pair of numbers (O(n^2)) and check if the negative value is in the table (O(1)). I checked Wikipedia and that is basically the simple version (though there are algorithms with a lower constant and lower storage).
But it seems strange that an algorithm that I can come up with in 15 seconds (and I'm not very good at this) is also optimal! It's more surprising that this can't be beat (or couldn't be beat). So there must be something more to the story.
Yes that’s the idea, these conjectures basically say “there’s no better algorithm than the naive/brute force one”. It’s like if P!=NP, then there’s no (asymptotically) better algorithm for SAT than naive backtracking search.
I don't really understand. The fact that, until now, no one's been able to come up with a better algorithm than the one everyone thinks of in 15s is what makes it an interesting conjecture.
It's made more tantalising by the fact that O(n^2) is so much larger than O(n) (the obvious lower bound needed to read the input), which suggests "room" for "something clever to do better".