dsa2 min read
LRU Cache — Doubly Linked List + HashMap Implementation
Implement LRU Cache from scratch using a doubly linked list with sentinel nodes and a hash map for O(1) operations.
Read →
1575 articles
Implement LRU Cache from scratch using a doubly linked list with sentinel nodes and a hash map for O(1) operations.
Design a browser history with visit, back, and forward operations using a doubly linked list for O(1) navigation.
Complete cheatsheet for Linked Lists: all 7 patterns, template code, Big O reference, and MAANG interview priority guide.
Master Segment Trees and Binary Indexed Trees: range sum/min/max queries, point updates, lazy propagation, and 5-language implementations.
Support point updates and range sum queries. BIT (Fenwick Tree) gives O(log n) both operations with elegant implementation.