Design a data structure that supports insert(x), remove(x), and get_random() that returns a uniformly random element among the present items, all in expected O(
-
time. Detail the algorithms and data structures you would use, how you handle deleting the last element and gaps, and how you would test the uniformity of get_random(). Discuss extensions such as supporting duplicates or thread-safety and the impact on complexity.