Skip to content
forked from aozturk/HashMap

Basic HashMap (Hash Table) Implementation in C++

Notifications You must be signed in to change notification settings

ssanupam24/HashMap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Basic Hash Map Implementation in C++

Compile and run tests

make

Example Usage

Define a hash function by overloading operator() for integer type key

struct MyKeyHash {
	unsigned long operator()(const int& k) const
	{	
    	return k % 10;
	}
};

Declare a hashmap with integer type key and string type value pair

HashMap<int, string, MyKeyHash> hmap;

Put a key-value pair into the hashmap

hmap.put(1, "1");

Get the value by key; returns true if successful with value updated

string value;
bool result = hmap.get(2, value);

About

Basic HashMap (Hash Table) Implementation in C++

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published