Modules
LRU Cache
LRU Cache is a cache data structure that holds a limited number of key-value pairs. When the cache is full, the least recently used key-value pair is removed to make room for a new one.
Implementation
See LRUCache.ts
Usage
const cache = new LRUCache(2);
cache.put("key1", "value1");
cache.put("key2", "value2");
cache.get("key1"); // returns "value1"
cache.put("key3", "value3"); // evicts key2
cache.get("key2"); // returns -1 (not found)
cache.get("key3"); // returns "value3"