Suppose we will need these operations (and only these) on data to be stored and all operations must have the indicated running time restriction:
- insert(x) - must be O(log(N), preferably O(1)
- contains(x) - must be O(1)
A class is to be written with these public methods. A private data member will store the actual data and be used to implement the public methods.
Which type could be used for the private data member?
- LinkedList
- ArrayList
- Binary Search Tree
- AVL Tree
- Min Heap
- Max Heap