반응형

#List

Class NameAddRemoveGetContains
ArrayListO(1)O(n)O(1)O(n)
LinkedListO(1)O(1)O(n)O(n)

#Set

Class NameAddContainsNext
HashSetO(1)O(1)O(h/n)
LinkedHashSetO(1)O(1)O(1)
EnumSetO(1)O(1)O(1)
TreeSetO(log n)O(log n)O(log n)

#Queue

Class NameOfferPeakPollSize
PriorityQueueO(log n)O(1)O(log n)O(1)
LinkedListO(1)O(1)O(1)O(1)
ArrayDequeueO(1)O(1)O(1)O(1)
DelayQueueO(log n)O(1)O(log n)O(1)

#Map

Class NameGetContainsKeyNext
HashMapO(1)O(1)O(h/n)
LinkedHashMapO(1)O(1)O(1)
WeakHashMapO(1)O(1)O(h/n)
EnumMapO(1)O(1)O(1)
TreeMapO(log n)O(log n)O(log n)


* 참고

http://kwseo.github.io/2015/09/24/time-complexity-about-collections/


반응형