Вопрос

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)?

Это было полезно?

Решение

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.

Другие советы

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top