Question DSA-HASH-0079
HardWhich data structure gives O(1) average insert, delete and getRandom?
- A.
A balanced BST
- B.
A heap
- C.
A linked list
- D.
A hash map from value to index plus an array, swapping the deleted element with the last
Sign up free to see the answer and a step-by-step explanation.