Skip to content

Commit

Permalink
Update time complexity table for LRU.
Browse files Browse the repository at this point in the history
  • Loading branch information
trekhleb committed Jan 23, 2023
1 parent f6a0ed4 commit fbd7755
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/data-structures/lru-cache/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit fbd7755

Please sign in to comment.