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.
Expressing Redis Time Complexity
-
25-06-2023 - |
質問
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)?
解決
他のヒント
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.
所属していません StackOverflow