Home/Algo Bridge/LRU / LFU Cache (Hash + Doubly Linked List)/LC_146
⚡ Practice in Flashcards
🌉 Problem-Level AI BridgeLC_146 · 中等

LC_146 (LRU Cache) ➔ RadixAttention: Longest Prefix Match KV Cache

Doubly linked list paired with hash table guarantees O(1) eviction and lookup for recency-based memory retention.

1️⃣ 1️⃣ Classical DSA Origin

LC_146 · LRU Cache

Pattern: LRU / LFU Cache (Hash + Doubly Linked List) — Hybrid architecture combining hash table with a doubly linked list. The hash table provides O(1) direct address lookup, while the doubly linked list maintains recency access order (LRU) or frequency (LFU) for O(1) insertion, elevation, and eviction.

⚡ Open LC-146 Solution ➔
2️⃣ 2️⃣ Production AI System Transfer

SGLang RadixAttention Prefix Caching & KV Tree Management · RadixAttention: Longest Prefix Match KV Cache

Industrial Application: Powers vLLM block eviction and SGLang RadixAttention node pruning when GPU HBM approaches allocation thresholds.

🧬 Target AI Kernel Interface
class SimpleRadixCache:
    def insert(self, tokens: list[int]) -> None
    def match_prefix(self, prompt_tokens: list[int]) -> int

🔗 Related Algorithmic Bridges

LC_140 ➔ RadixAttention: Longest Prefix Match KV Cache
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_140 ➔ Prefix Cache Attention Block
Algorithmic foundation connecting classic data structures to LLM high-pe...
LC_208 ➔ RadixAttention: Longest Prefix Match KV Cache
Trie structures merge identical token prefixes across diverging branches...
LC_208 ➔ Prefix Cache Attention Block
Trie structures merge identical token prefixes across diverging branches...
LC_146 ➔ Prefix Cache Attention Block
Doubly linked list paired with hash table guarantees O(1) eviction and l...
LC_146 ➔ PagedAttention: Virtual Memory Block Table Mapping
Doubly linked list paired with hash table guarantees O(1) eviction and l...
← LC_208 (Implement Trie) → SGLang RadixAttention Prefix Caching & KV Tree ManagementLC_146 (LRU Cache) → SGLang RadixAttention Prefix Caching & KV Tree Management →