Tag

O(1)

1 views collected around this technical thread.

Architect's Guide
Architect's Guide
Sep 10, 2022 · Fundamentals

Java Implementation of an O(1) LRU Cache Using a Doubly Linked List and HashMap

This article explains the design and Java implementation of an LRU (Least Recently Used) cache that achieves O(1) time complexity for get and put operations by combining a doubly linked list with a hash map, and provides full source code and usage examples.

Data StructureJavaLRU Cache
0 likes · 10 min read
Java Implementation of an O(1) LRU Cache Using a Doubly Linked List and HashMap