Top "Hashmap" questions

A data structure that uses a hash function to map identifying values, known as keys, to their associated values

Iterate through a HashMap

What's the best way to iterate over the items in a HashMap?

java loops hashmap iteration
What are the differences between a HashMap and a Hashtable in Java?

What are the differences between a HashMap and a Hashtable in Java? Which is more efficient for non-threaded applications?

java collections hashmap hashtable
Java Hashmap: How to get key from value?

If I have the value "foo", and a HashMap<String> ftw for which ftw.containsValue("foo") returns true, …

java hashmap
How to update a value, given a key in a hashmap?

Suppose we have a HashMap<String, Integer> in Java. How do I update (increment) the integer-value of the …

java key hashmap
JavaScript hashmap equivalent

As made clear in update 3 on this answer, this notation: var hash = {}; hash[X] does not actually hash the object …

javascript data-structures language-features hashmap
java.lang.OutOfMemoryError: GC overhead limit exceeded

I am getting this error in a program that creates several (hundreds of thousands) HashMap objects with a few (15-20) …

java hashmap heap heap-memory g1gc
How to sort Map values by key in Java?

I have a Map that has strings for both keys and values. Data is like following: "question1", "1" "question9", "1" "question2", "4" "question5", "2" …

java dictionary hashmap
get string value from HashMap depending on key name

I have a HashMap with various keys and values, how can I get one value out? I have a key …

java collections hashmap
Key existence check in HashMap

Is checking for key existence in HashMap always necessary? I have a HashMap with say a 1000 entries and I am …

java hashmap
How to create a simple map using JavaScript/JQuery

How can you create the JavaScript/JQuery equivalent of this Java code: Map map = new HashMap(); //Doesn't not have to …

javascript jquery hashmap