If a specific O(N) complexity or even a runtime in milliseconds is required or desired, shouldn't that be an explicit part of the question?