Cache

LRU

Least Recently Used

AlgorithmComplexity
SpaceO(n)
GetO(1)
PutO(1)
  1. Implemented by Built-in Structures
  1. Implemented by hash table and doubly linked list

LFU

Least Frequently Used

AlgorithmComplexity
SpaceO(n)
GetO(1)
PutO(1)

Tests