Question d’entretien chez Morgan Stanley

How does HashMap works? What is the time complexity of the get method in HashMap?

Réponse à la question d'entretien

Utilisateur anonyme

14 sept. 2018

Time complexity of get method is O(1). Hashmap internally uses an array of Entry to store elements. Key & value are stored in this array after performing hashing of key.

2