5 ms·
Amortized cost is a technical term in complexity analysis: https://en.wikipedia.org/wiki/Amortized_analysis https://en.wikipedia.org/wiki/Amortized_analysis If
by justinpombrio 6y ago
Amortized cost is a technical term in complexity analysis:
https://en.wikipedia.org/wiki/Amortized_analysis https://en.wikipedia.org/wiki/Amortized_analysis
If you use the terminology precisely, the worst case cost of a regular hash table insertion is O(n) because of the potential resize, but its amortized cost is O(1) because that's what it "averages out to".