LeetCode 146. LRU Cache Explanation with Examples

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


Thanks in advance. :D

Happy coding every day!
Рекомендации по теме
Комментарии
Автор

It's a very nice explanation !!! The only thing missing in the video is map.put(key, node); before line 63 . It gives nullPointerException.

AmeyaKherodkar
Автор

Could I add the most recent node to the last and remove the least recent node from the head?

julielong
Автор

Thanks! in addHead() do we need to check whether head next is not null before updating its prev?

anant
Автор

Great explanation!!! Thanks for sharing.

umber