|
|
|
|
|
by RomanPushkin
1043 days ago
|
|
1. I like toxic comments like that saying something is simple without actually solving the problem, you're the best. 2. The average complexity to search, insert, and delete data in a hash table is O(1), for interviews it works 99% of the time. 3. There is alternative O(1) solution you're looking for, I'll leave this exercise to you, bro. As well as the other exercise of being less toxic and a bit more respectful to people you don't know online lol. |
|
To be actually toxic for a moment, you do know that amortized and average are different right?
There is an easy solution to get O(1) for all operations too by allowing them to throw an exception: a simple array. There is no other O(1) solution for all operations that I am aware. In fact it is probably not too difficult to prove that such a solution does not exist.