Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Design HashMap in Python #2126

Open
Robinrai2612 opened this issue Oct 6, 2023 · 1 comment
Open

Design HashMap in Python #2126

Robinrai2612 opened this issue Oct 6, 2023 · 1 comment

Comments

@Robinrai2612
Copy link

Robinrai2612 commented Oct 6, 2023

@shivaylamba I would like to address this issue. Please assign this task to me.

@Robinrai2612
Copy link
Author

Design a HashMap without using any built-in hash table libraries.

Implement the MyHashMap class:

MyHashMap() initializes the object with an empty map.
void put(int key, int value) inserts a (key, value) pair into the HashMap. If the key already exists in the map, update the corresponding value.
int get(int key) returns the value to which the specified key is mapped, or -1 if this map contains no mapping for the key.
void remove(key) removes the key and its corresponding value if the map contains the mapping for the key.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant