Question

The time complexity of Redis' HDEL is O(N) (where N is the number of fields to be removed). I have a use case where the field must undergo a type conversion for every operation. How would I express the new time complexity? O(N*2)?

Était-ce utile?

La solution

The time complexity will be the same: O(N). Big-O notation is not about clock time, but about scalability. See here for an excellent and easy overview.

Autres conseils

Complexity will still be O(n).

Take this example:
Algorithm to traversing a linked list of size 'n' is O(n). Traversing it twice is still O(n). Read http://en.wikipedia.org/wiki/Big_O_notation to difference between O notation and Θ notation.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top