Re:IBM's Asshole Test
by qumpis on Wednesday May 04, 2022 @07:57PM
(#31267516)
What structure should there be for nlogn solution to be applicable?
[ Parent
| on HN ]
The issue isn't structure but rather density. If you have N values ranging from -M to M, the "obvious" solution is O(N^2) and the convolution us O(M log M). So if you have lots of values within a narrow range the convolution wins.