Problem Statement
Which data structure gives expected O(1) average time for insert, delete and lookup operations?
Explanation
A hash table uses a hash function to map keys to buckets, enabling average constant time for insert, delete and lookup under good hash & load conditions. The other structures do not guarantee O(1) for all these operations.
Code Solution
SolutionRead Only
Map<Key,Value> map = new HashMap<>(); map.put(key, value); map.get(key); map.remove(key);
