LRU Cache Walkthrough (Leetcode #146)

preview_player
Показать описание
In this video I walk through a solution for LRU Cache (Leetcode #146) to help with knowledge dictionaries and doubly linked lists.


Рекомендации по теме
Комментарии
Автор

God bless you, after countless Hindi lectures finally something which makes sense to me...

vladimirvisnovsky
Автор

I was surprised that this problem is ranked hard, not because I think it's super easy but bc of how clear your logic was, thank you!

NYmarlon
Автор

You were pretty honest overall! I liked the effort.

blitzspirit
Автор

Yes, a very clear presentation. Good work.
One small quibble: At ~11:40, the node.next should become prev.next since the insertion may not be exactly at the tail, right? Ditto for line 25 vis-a-vis the reference to tail. The nice thing about the head and tail sentinels is their facilitation of positional agnosticism (no need for special-casing in the linkage update for head/tail).

chronos
Автор

YOU ARE AWESOME!!!! This is really clear! Also, did you get your arms from programming??

ReneeSLiu-zxtj
Автор

Lucid Explanation. Can you please provide solutions for all leetcode solutions ?

hamsinisankaran
Автор

Amazing tutorial, very clear and conscience. Thanks!

reyou
Автор

Amazingly simple explanation. Thank you so much!

vigilo
Автор

What are we adding as the value into the dictionary?

demonpreet
Автор

Brolic. Great tutorial. Better than using Ordereddict().

colorfulcodes
Автор

Do you need a hahtable/dict? I imagine you can accomplish the same using a Set on known values.

andrewfacchiano
Автор

shouldn you be adding from the head and popping from the tail? And why use a double linked list when you can use a single linked list to implement a queue?

Soccercrazyigboman
Автор

Thank you so much. you made it look so much! :)

sourabhguptaurl
Автор

Thank you so much! This was so helpful!

linhphan
Автор

Good try but has some awkward conventions. First off, adding to the tail is unconventional, through me for a loop when its usually you add to the head. Also, noticed he isn't familiar with Python, strange syntax, "next" is a keyword in python. Could have just done a circular linked list instead. More than 50 lines of code in an interview is fine. I believe 100 lines for most interviews means you are doing something wrong.

joe-se
Автор

couldn't this be done with a hashtable ?

SulixD
Автор

can you do in C instead of python. I dont know python. what is best way to get in touch with you

dumbbel
Автор

didn't really no what you was talking about lol did you, maybe first you should learn it yourself before teaching others?

anon-slvp
join shbcf.ru