Created
July 4, 2019 08:42
-
-
Save AvraamMavridis/9d3e6f2639dd55ee07daa24d8519b1b7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Build a data structure that implements the following 3 functions: | |
- set(key, value) → sets key and value in the data structure and returns nothing. | |
- get(key) → returns the value that was set for this key (null if doesn’t exist) | |
- set_all(value) → sets the value for all keys that are in the data structure. Returns nothing. | |
The catch is that each of the functions should run in constant time - O(1). | |
Can assume in-memory simple single thread process. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment