Re:Removing Array Duplicates
by magicalhippo on Friday April 12, 2019 @09:14AM
(#19644479)
Of course, for low values of N the constants dropped from the big-O notation start to matter. For very small values of N and a random-access input, even an O(N^2) approach may be optimal (for each input element, check for equality against previous elements of the input, output if no hit).
[ Parent
| on HN ]
Well, when N is small, any complexity analysis is moot.
Re:Removing Array Duplicates
by magicalhippo on Sunday April 14, 2019 @05:35AM
(#19658390)
Yes, but it's easy to forget and still apply it blindly in regimes where it's not really applicable anymore.