Skip to content

soloiaros/hash-map-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Custom Hash Map data structure implementation

An ASCII representation of the structure

[INDEX]      [BUCKET ARRAY]          [LINKED LIST NODES]

 0       |      •-------|------> [ Key: "Apple" | Val: 5 ] -> [ Key: "Grape" | Val: 2 ] -> NULL
         |              |
 1       |    EMPTY     |
         |              |
 2       |      •-------|------> [ Key: "Banana" | Val: 12 ] -> NULL
         |              |
 3       |      •-------|------> [ Key: "Pear" | Val: 8 ] -> [ Key: "Mango" | Val: 3 ] -> NULL
         |              |
 4       |    EMPTY     |

Performance Time Complexity

Average Case: $O(1)$ for insertions, deletions, and lookups.Worst Case: $O(n)$ if the hash function distributes keys poorly, causing all entries to collide into a single linked list.

About

My custom implementation of the Hash Map data structure. It also features custom Linked Lists that accommodate for more efficient extraction of data than the built-in arrays.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors