educative.io

Time complexity of hash map implementation

in the worst-case scenario, we may need to iterate through an entire bucket to find the desired value, resulting in a time complexity of O(n/k) for each method.

In the worst case, would all our items map to the same bucket, leading to a linear search and O(n) time for each method?


Course: Grokking Coding Interview Patterns in Python - AI-Powered Learning for Developers
Lesson: Solution: Design HashMap - Grokking Coding Interview Patterns in Python