A custom-built implementation of HashMap
and HashSet
in JavaScript with collision handling, dynamic resizing, and a web UI for easy interaction and testing.
This project replicates core behaviors of hash-based data structures, demonstrating how keys are hashed, collisions are managed, and capacity is scaled. A simple and interactive UI is included to manipulate and test the data structures in real time.
set(key, value)
,get(key)
,has(key)
,remove(key)
,length()
,clear()
,keys()
,values()
,entries()
- Collision handling with separate chaining
- Dynamic resizing when load factor is exceeded
- Protection against out-of-bounds access
- Stores unique keys (no values)
add
,has
,remove
,clear
,keys
,length
Click the Run Tests button in the UI to validate core features of both structures.
Use the HTML interface to interact with both HashMap
and HashSet
.
- Download or clone the repository
- Open
index.html
in your browser - Use the form and buttons to interact with the data structures
index.html
– Interactive UI and logicREADME.md
– Project documentation