Provides a class HashMap
with these methods:
hash(value)
generates a hashed index smaller than the table size.set(key, value)
adds a value to the HashMap that is assigned to a key.get(key)
returns value assigned to a key, returns null if value wasn't found.has(key)
returns true if key is present in the HashMap, false if not.remove(key)
removes key and assigned value to it from the HashMap.getLength()
returns total number of keys stored in the HashMap.clear()
removes all entries from HashMap.getKeys()
returns an array containing all keys inside the HashMap.getValues()
returns an array containing all values inside the HashMap.getEntries()
returns an array containing key-value pairs in the this format[key, value]
HashSet
is similar to HashMap
, but doesn't have value, and value based methods.