Is Java Hash Map 's ContainsKey() O(1) time complexity? How about other contains, like String's, list's?
I think that map and set can reach O(1), String and list maybe O(n).
Thanks a lot, I know it now. HashMap's containsKey() is a amortized O(1) time.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.