You are viewing a single comment's thread. Return to all comments →
No it is O(1). It is basicallly calculating the hashcode!
He is talking about map.containsValue NOT containsKey. So you basically have to iterate through the map to know whether desired value is present in the map or not. And that's O(n). where n is the number of keys present in the map.