O(1) Randomized Set
Use a dynamic array plus a hash map from value to its array index. The array provides O(1) random access and random selection. The hash map provides O(1) average lookup. For deletion, swap the element to remove with the last array element, update its index in the map, and remove the last slot.
Search: O(1) average.
Insert: O(1) amortized.
Delete: O(1) average.
getRandom: O(1).
Random selection is uniform when selecting uniformly from array indices.