LRUCache(int capacity)
initializes the cache to store data of size: capacity.int get(int key)
returns the value of the key if it exists, otherwise returns -1.void add(int key, int value)
updates the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key.
-
Notifications
You must be signed in to change notification settings - Fork 0
Least Recently Used Cache
License
SKAUL05/LRU
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Least Recently Used Cache
Topics
Resources
License
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published