Is there any data structure or variation of existing data structure that offers O(1) or constant time complexity for delete operation ?
I know hash table can do it. But I am modifying hash table where, we can get all the the keys without going through all the buckets and in order to do so I am storing every key in another linked list and at the time when I add it to hash table. So I can get all the keys in quick.
What about HashSets? They offer constant time performance for add/remove/contains/size.
In java, it is called a HashSet
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With