4 ms·
Ordinary hash maps are still amortized expected O(1) — they will hit an O(n) case, guaranteed, when they need to grow the array, and it’s expected that the amor
by Ferrotin 4y ago
Ordinary hash maps are still amortized expected O(1) — they will hit an O(n) case, guaranteed, when they need to grow the array, and it’s expected that the amortized runtime is O(1).
Being merely “expected O(_)” would be appropriate for algorithms that lack amortization, such as quick sort.