Skip to content

Latest commit

 

History

History
18 lines (16 loc) · 879 Bytes

File metadata and controls

18 lines (16 loc) · 879 Bytes

HashMap implementation in React

In this project, I have implemented an HashMap class which has the following functionalities -

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

Installation

  • Pull this branch into your local system.
  • Make sure you have Node installed (preferrably Node v18.17.1).
  • Navigate to the project directory and run
    npm install
    
  • Once all the dependencies have been installed, run the following command to start the dev server.
    npm run dev