Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add an example of the LRU (Least Recently Used) Cache implementation #980

Merged
merged 3 commits into from
Jan 23, 2023

Conversation

trekhleb
Copy link
Owner

The LRUCache implementation example. 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).

@trekhleb trekhleb merged commit e4f2ccd into master Jan 23, 2023
@trekhleb trekhleb deleted the lru-cache branch January 23, 2023 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant