3 ms·
I agree; there are a lot of tradeoffs you can make for the map type, and having O(1) amortized deletion usually comes at a cost of making all the other operatio
by aidenn0 8y ago
I agree; there are a lot of tradeoffs you can make for the map type, and having O(1) amortized deletion usually comes at a cost of making all the other operations slower (either by a constant factor, or asymptotically).
I do wish more people were aware of this because (as you say) deletions are much more rare.
Often compilers will use a non-standard map for just this reason (symbol tables basically never delete).