LinkedHashMap

4 July, 2023
by Mark Teisman

LinkedHashMap is hash map data structure that weaves in a doubly-linked list. Each hash map entry does not only hold the entry's data, but also pointers to the previous and next entries. This is useful when you need to support (ordered) traversal through the map. Supports for instance least-recently-used (LRU) caches, or insertion-order traversal.