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

[NEW ALGORITHM] Add Hashmap Data Structure #1181

Closed
2 tasks done
Riya7045 opened this issue Oct 23, 2024 · 3 comments
Closed
2 tasks done

[NEW ALGORITHM] Add Hashmap Data Structure #1181

Riya7045 opened this issue Oct 23, 2024 · 3 comments

Comments

@Riya7045
Copy link
Contributor

Riya7045 commented Oct 23, 2024

Hashmap

About:

We need to implement a hashmap (hash table) data structure to support efficient key-value storage and retrieval. The hashmap will offer basic functionalities like insertion, search, and deletion, with collision handling via chaining using linked lists. This implementation should work for integer keys and values as the primary use case.

Key Tasks:

Hashmap Structure:

Define a hashmap structure that includes an array of pointers (buckets).
Each bucket should point to a linked list to handle collisions (chaining).

Hash Function:

Create a hash function that maps integer keys to an index based on the table size using modulo (% operator).

Basic Operations:

Insert: Add a key-value pair to the hashmap. Handle collisions by inserting the new entry into a linked list.
Search: Retrieve a value based on a given key. If the key is not found, return a default error code (e.g., -1).
Delete: Remove a key-value pair from the hashmap, handling re-linking of nodes in the linked list for collision cases.

Labels:

new algorithm, gssoc-ext, hacktoberfest, level1


Assignees:

  • Contributor in GSSoC-ext
  • Want to work on it
@lakshita10341
Copy link

can u assign me this issue?

@pankaj-bind
Copy link
Collaborator

@Riya7045 assigned

@Riya7045
Copy link
Contributor Author

ok i will start working on this issue.

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

No branches or pull requests

3 participants