Let a dictionary with the operations
search(). Each one of them has time complexity of $O(logn)$. Implement (efficiently)
opposite()operation which return true if there are two opposite numbers in the dictionary (i.e. $5$ and $(-5)$)
I advised to use another data structure.
I thought about a binary search tree. We maintain a binary search tree and for every
insert() we also insert the item into the tree.
What do you think?