Reputation: 1
I was looking for a data structure with delete o(1) and random access o(1) for my project. Could anybody help ?
Upvotes: 0
Views: 844
Reputation: 59144
If you insist on those complexities and you don't have to release memory in the table as soon as keys are deleted, then you can use dynamic perfect hashing.
It's a little complicated: https://en.wikipedia.org/wiki/Dynamic_perfect_hashing
To get O(1) deletes you'll have to defer any rehashes caused by delete until the next insert.
Upvotes: 1