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″]

KodNest Training New Batch is starting on 02nd November 2020. Attend one week free demo classes.Register Now

New Report