Update time complexity table for LRU.

This commit is contained in:
Oleksii Trekhleb 2023-01-23 18:44:46 +01:00
parent f6a0ed42bc
commit fbd77551b3

View File

@ -16,7 +16,7 @@ The functions `get()` and `set()` must each run in `O(1)` average time complexit
## Implementation
See the `LRUCache` implementation example in [LRUCache.js](./LRUCache.js). The solution uses a `HashMap` for fast `O(1)` cache items access, and a `DoublyLinkedList` for fast `O(1)` cache items promotions and eviction (to keep the maximum allowed cache capacity).
See the `LRUCache` implementation example in [LRUCache.js](./LRUCache.js). The solution uses a `HashMap` for fast `O(1)` (in average) cache items access, and a `DoublyLinkedList` for fast `O(1)` (in average) cache items promotions and eviction (to keep the maximum allowed cache capacity).
![Linked List](./images/lru-cache.jpg)