You are viewing a single comment's thread. Return to all comments →
Inserting into a hashtable is not O(1), though. Neither is lookup, they are both amortized O(log n), so your total complexity is O(n log n).
Seems like cookies are disabled on this browser, please enable them to open this website
Pairs
You are viewing a single comment's thread. Return to all comments →
Inserting into a hashtable is not O(1), though. Neither is lookup, they are both amortized O(log n), so your total complexity is O(n log n).