O(1) insert, search, delete and random on a set of numbers
Filed under Livspace
The question
Design a data structure supporting Insert(n), Search(n), Delete(n) and Random() (each number returned with equal probability), all in O(1).
No write-up yet. Related questions below have one.
Related Livspace questions
Collected from public candidate posts and coding forums. Updated Nov 2026.