I need to know: What is the time complexity of HashMap.containsKey() in java?
Generally O(1), but if we're using a bad hashCode function, we need to add multiple elements to one bucket so it can be O(n) in worst case.