4 ms·
Okay, now I'm curious: how'd they manage to get O(n^2) asymptotic complexity out of what looks like a relatively simple semi-transparent photo overlay?
by facetube 11y ago
Okay, now I'm curious: how'd they manage to get O(n^2) asymptotic complexity out of what looks like a relatively simple semi-transparent photo overlay?
- Bahamut 11y agoProbably a double for loop iterating over each row of pixels and then each pixel in each row (or column).
- placeybordeaux 11y agoThat sounds like it would only touch each pixel once: the minimum amount of times.
- facetube 11y agoRight, that's why I'm confused. If n is the number of pixels, then 4 million operations would be linear-time as far as I can tell. Wonder if the author took n to be the width/height of the image.