We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Frequency Queries
You are viewing a single comment's thread. Return to all comments →
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.