Junior Collections

What is the time complexity of searching for a key in a Dictionary?

The average time complexity is O(1) (constant time), thanks to hash-based indexing.

However, in worst-case scenarios (rare), it can degrade to O(n).

Follow:

More from C# Programming Tutorial

All questions for this course