LRU Cache
evanplaice opened this issue · 1 comments
evanplaice commented
Implement a LRU (Least Recently Used) Cache
Checklist
- implementation
- tests
- jsdoc
Specifics
- the cache has a fixed
capacity
defined during creation put(key, value)
adds an item to the top of the stackput(key, value)
when thecapacity
is exceeded the bottom item is removedget(key)
returns the value ofitem[key]
get(key)
moves the item to the top of the stackput(key, value)
mutates the value if it already exists on the stack
Notes
References
evanplaice commented
Added in v0.11