Top "Hashmap" questions

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

How does HashSet not allow duplicates?

I was going through the add method of HashSet. It is mentioned that If this set already contains the element, …

java hashmap hashset
How is the implementation of LinkedHashMap different from HashMap?

If LinkedHashMap's time complexity is same as HashMap's complexity why do we need HashMap? What are all the extra overhead …

java hashmap complexity-theory linkedhashmap
Method to extract all keys from LinkedHashMap into a List

I am working with many LinkedHashMap that are either LinkedHashMap<Long, Long>, LinkedHashMap<Long, Double> or …

java map hashmap key linkedhashmap
When to use linkedhashmap over hashmap in java?

What are the practical scenario for choosing among the linkedhashmap and hashmap? I have gone through working of each and …

java data-structures types hashmap linkedhashmap
Why does HashMap require that the initial capacity be a power of two?

I was going through Java's HashMap source code when I saw the following //The default initial capacity - MUST be …

java hashmap hashtable hash
cast LinkedHashMap to HashMap in groovy

How do I convert LinkedHashMap to java.util.HashMap in groovy? When I create something like this in groovy, it …

java collections groovy hashmap linkedhashmap
Best way to store Country codes, names, and Continent in Java

I want to have a List or Array of some sort, storing this information about each country: 2 letter code Country …

java arrays linked-list hashmap treemap
Is it possible to create a HashMap that is Parcelable on Android?

I am trying to extend HashMap as a Parcelable and I got the syntax to compile, however, at runtime it …

android hashmap parcelable
How to lookup from and insert into a HashMap efficiently?

I'd like to do the following: Lookup a Vec for a certain key, and store it for later use. If …

hashmap rust lookup
How do I get a list of all JSON paths to values from a JSON String?

My goal is to read a JSON file and understand the location of all the values, so that when I …

java json hashmap jsonpath