LeetCode 146 LRU Cache

preview_player
Показать описание

(My submission is a bit different)

Topics:
What is an LRU Cache? 0:43
Walk through given example 1:05
Identifying a solution 3:29
Solution explanation 4:41
Checking our solution against the example 6:57
Code Implementation:
- Doubly Linked List Node Class 9:27
- LRU Cache Initialiser 9:50
- Add Node to Linked List 10:28
- Remove Node from Linked List 11:37
- Put items into LRU Cache 12:36
- Get items from LRU Cache 14:09
Рекомендации по теме
Комментарии
Автор

This is what I want to see. A train of thoughts - How you come up with the solution, not only about what the solution is and how it works. Big thanks from 2021

quocanhhbui
Автор

really impressive explanation! thank you!

revdevstudios
Автор

With this oslution, the remove node function throws an error if you have less than two items in the cache.

Soccercrazyigboman
Автор

Love it! Curious why do we need a Doubly Linked List? Wouldn't a singly linked list suffice?

rahulsonwalkar
Автор

Shouldn't the head be most recently used?

quixoticfallcy
Автор

Can we put the value/data in the dictionary instead in node? Why or why not?

sophiafeng
Автор

you can just tell by his voice that he’s hot

aishaxlovesxD