Home » Tip Bank » Java
  • Email Article
  • Comment on this Article
  • Share Article
    • Digg
    • del.icio.us
    • Newvine
    • furl
    • StumbleUpon
    • BlinkList
    • Newsvine
    • Magnolia
    • Facebook
    • Tailrank
    • Slashdot
    • Technorati
    • Google Bookmarks
    • Yahoo Favorites
    • Windows Live
    • Ask
Language: Java
Expertise: Intermediate
Aug 2, 2017

Java Collections Performance, MAP

Improve Java performance with MAP.

              
                                 Add      Contains keys       Next           Data Structure
HashMap                          O(1)          O(1)            O(h/n)          Hash Table
EnumMap                          O(1)          O(1)            O(1)            Array
LinkedHashMap                    O(1)          O(1)            O(1)            Hash Table+Linked List
TreeMap                          O(log n)      O(log n)        O(log n)        Red-black tree
ConcurrentSkipListMap            O(log n)      O(log n)        O(1)            Skip List
ConcurrentHashMap                O(1)          O(1)            O(h/n)          Hash table
IdentityHashMap                  O(1)          O(1)            O(h/n)          Array
WeakHashMap                      O(1)          O(1)            O(h/n)          Hash table
Octavia Anghel
 
Submit a Tip
Browse "Java" Tips
Browse All Tips
googlecode.com
eloquentjavascript.net