Question 2

Design a data structure which could perform the following operations in O(1):

– Insert(), Delete(), Search(), getRandom()

getRandom() should pick a “random” element from your data structure, and should not be predictable (for instance always picking the “first” element from your DS).

[advanced_iframe securitykey=”undefined” src=”” width=”100%” height=”600″]

Request A Callback

Get a Free 30-minute Counseling session with our experts.