Created
February 27, 2016 20:26
-
-
Save robatron/217b56c033a6e3031c30 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Represents a hash table implemented on top of an array where each bucket is | |
* also an array. | |
*/ | |
class HashTable { | |
// Create a new hash table instantiated with the table size, the size of | |
// the the array | |
constructor(tableSize) {} | |
// Retreive a value of the key stored in the hash table. Return null if | |
// not found. | |
get(key) {}; | |
// Place a key-value pair in the hash table | |
put(key, val) {}; | |
// Remove the specified entry from the HashMap if found. Returns the value | |
// of the removed entry | |
remove(key) {}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Would a get return null instead of undefined? I'd imagine null would be a valid value