mirror of
https://github.com/trekhleb/javascript-algorithms.git
synced 2025-07-10 21:41:17 +08:00
Update time complexity table for LRU.
This commit is contained in:
@ -16,7 +16,7 @@ The functions `get()` and `set()` must each run in `O(1)` average time complexit
|
|||||||
|
|
||||||
## Implementation
|
## 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).
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
Reference in New Issue
Block a user