Doubly-Linked-List
LeetCode 460: LFU Cache
·3 mins
LeetCode
Hard
Hash-Table
Linked-List
Design
Doubly-Linked-List
LeetCode 460 note: key → node, freq → doubly linked list, plus a min_freq; within the same frequency, LRU decides what to evict
LeetCode 146: LRU Cache
·3 mins
LeetCode
Medium
Hash-Table
Linked-List
Design
Doubly-Linked-List
LeetCode 146 note: a hash map finds nodes and a doubly linked list keeps the usage order; both get and updating an existing key must move the node to the front