Worse case time complexity put/get HashMap

前端 未结 5 1981
后悔当初
后悔当初 2021-02-10 22:41

What is the worst case time complexity of an Hashmap when the hashcode of it\'s keys are always equal.

In my understanding: As every key has the same hashcode it will al

5条回答
  •  借酒劲吻你
    2021-02-10 23:43

    HasMap Complexity

    
              Best.  Avg.   Worst
      Search  O(1)   O(1)   O(n)
      Insert  O(1)   O(1)   O(n)
      Delete  O(1)   O(1)   O(n)
    

    Hope that will help in short

提交回复
热议问题