Tag

Doubly Linked List

0 views collected around this technical thread.

IT Services Circle
IT Services Circle
Mar 12, 2024 · Fundamentals

LRU Cache Design and Java Implementation with O(1) Operations

This article explains the LeetCode LRU Cache problem, detailing the required class interface, operational constraints, and provides a thorough Java solution using a HashMap combined with a doubly linked list to achieve O(1) time complexity for get and put operations.

AlgorithmData StructuresDoubly Linked List
0 likes · 10 min read
LRU Cache Design and Java Implementation with O(1) Operations
Sanyou's Java Diary
Sanyou's Java Diary
Feb 16, 2022 · Fundamentals

Mastering LRU Cache: Hand‑Write a Least Recently Used Algorithm in Java

Learn how to implement a Least Recently Used (LRU) cache from scratch using a hash map combined with a doubly linked list in Java, covering the core concepts, node structure, get and put operations, and eviction logic to efficiently manage hot data.

Data StructuresDoubly Linked ListHashMap
0 likes · 6 min read
Mastering LRU Cache: Hand‑Write a Least Recently Used Algorithm in Java
Selected Java Interview Questions
Selected Java Interview Questions
Apr 6, 2021 · Fundamentals

Understanding LRU Cache and Its Implementation in Java and Redis

This article explains the LRU (Least Recently Used) caching principle, shows how to build an O(1) LRU cache using a HashMap and doubly linked list in Java, and describes Redis's approximate LRU eviction algorithm based on a global clock and random sampling.

AlgorithmDoubly Linked ListHashMap
0 likes · 9 min read
Understanding LRU Cache and Its Implementation in Java and Redis
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Jul 3, 2020 · Fundamentals

Understanding LRU Cache: Interview Thought Process and Implementation

This article explains why technical interviews focus on problem‑solving skills, outlines a four‑step interview approach, introduces the LRU cache eviction policy, analyzes required operations, selects HashMap plus a doubly linked list as the optimal data structures, and provides a complete Java implementation with detailed commentary.

AlgorithmCache EvictionDoubly Linked List
0 likes · 15 min read
Understanding LRU Cache: Interview Thought Process and Implementation