Implement An LRU Cache - The LRU Cache Eviction Policy ("LRU Cache" on LeetCode)

  Рет қаралды 174,352

Back To Back SWE

Back To Back SWE

5 жыл бұрын

Code - backtobackswe.com/platform/co...
Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe.com/pricing
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
Question: Implement an LRU Cache.
It is a cache replacement policy that says to evict the least recently used item in the cache.
Every time an item is used it goes to the "front" of the cache since it has been used and has priority.
Items that are not used will go to the "end" of the cache eventually and get evicted since they are the least used items, they never got a bump up by being used.
Additional Cache Eviction Policies: en.wikipedia.org/wiki/Cache_r...
What is a Cache?
A cache is a hardware or software component that stores data so that future requests for that data can be served faster; the data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere.
What Is An LRU Cache?
So a LRU Cache is a storage of items so that future access to those items can be serviced quickly and an LRU policy is used for cache eviction.
The Constraints/Operations
Lookup of cache items must be O(1)
Addition to the cache must be O(1)
The cache should evict items using the LRU policy
The Approach
There are many ways to do this but the most common approach is to use 2 critical structures: a doubly linked list and a hashtable.
Our Structures
Doubly Linked List: This will hold the items that our cache has. We will have n items in the cache.
This structure satisfies the constraint for fast addition since any doubly linked list item can be added or removed in O(1) time with proper references.
Hashtable: The hashtable will give us fast access to any item in the doubly linked list items to avoid O(n) search for items and the LRU entry (which will always be at the tail of the doubly linked list).
This is a very common pattern, we use a structure to satisfy special insertion or remove properties (use a BST, linked list, etc.) and back it up with with a hashtable so we do not re-traverse the structures every time to find elements.
Complexities
Time
Both get and put methods are O( 1 ) in time complexity.
Space
We use O( n ) space since we will store n items where n ist the capacity of the cache.
++++++++++++++++++++++++++++++++++++++++++++++++++
HackerRank: / @hackerrankofficial
Tuschar Roy: / tusharroy2525
GeeksForGeeks: / @geeksforgeeksvideos
Jarvis Johnson: / vsympathyv
Success In Tech: / @successintech
++++++++++++++++++++++++++++++++++++++++++++++++++
This question is number 13.3 in "Elements of Programming Interviews" by Adnan Aziz, Tsung-Hsien Lee, and Amit Prakash.

Пікірлер: 692
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Table of Contents: (I'm screaming in this video. I know. I am sorry.) Messing Around 0:00 - 0:23 Problem Introduction 0:23 - 0:36 What Does LRU (Least Recently Used) Mean? 0:36 - 1:10 Short Example of The LRU Policy 1:10 - 2:28 What Is A Cache? 2:28 - 2:53 What Is An LRU Cache? 2:53 - 3:12 The Properties of An LRU Cache 3:12 - 6:44 LRU Cache Operations Walkthrough 6:44 - 12:18 Summarizing The Ideas 12:18 - 12:53 More Subscriber Begging 12:53 - 13:12 Notes: 10:52 -> We need the nodes to hold their own keys. This matters when the LRU entry is evicted when capacity is surpassed. We just pop the item from the doubly linked list's end BUT I made the mistake to say the nodes won't need keys. They will need their respective key. We need the removed node's key to remove it from the hashtable since it is now out of the cache completely. Comments: Yes. I am screaming. I know. I messed up the first like 30 videos because I was still learning audio. The code is in the description. Note, we could also use Java's LinkedHashMap, but I choose to use this code example since it takes all that abstraction away so you see all of the critical operations that need to be taken care of if you were to really implement this.
@evanxg852000
@evanxg852000 5 жыл бұрын
It's ok to scream bro, it's just that passion driving you I guess. loving the channel.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@evanxg852000 hahahahha, nah, I just didn't have a mic
@michaelfekadu6116
@michaelfekadu6116 4 жыл бұрын
THANK YOU FOR SCREAMING! IT MADE LRU CACHE MAKE MORE SENSE! THIS VIDEO IS MORE MEMORABLE 😫😄
@toprank9602
@toprank9602 4 жыл бұрын
@@BackToBackSWE is this a system design question?
@asifbherani3490
@asifbherani3490 4 жыл бұрын
Such a nice explanation but very disappointing end to it as we dont have the code in description. Please update the video and description :(
@maripaz5650
@maripaz5650 3 жыл бұрын
just answered this question yesterday in an interview, bless your channel. Thanks to you, I was able to stumble upon the optimal solution a lot quicker than if I was working on my own!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great
@ANGELINK999
@ANGELINK999 4 жыл бұрын
I feel so lucky that I found your channel. Your videos are so easy to understand. You're awesome!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
Thanks haha - shameless plug, releasing a course in 1-2 months - it'll be 🔥
@MostafaAliMansour
@MostafaAliMansour 5 жыл бұрын
This channel is underrated, dude u r really awesome !
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Let's increase the rating
@RohitKumar-so9ik
@RohitKumar-so9ik 5 жыл бұрын
Yup seriously this man is way more than what we predict through his subs!!
@aditisaha99
@aditisaha99 4 жыл бұрын
Really great channel. The level of energy you have is insane. It motivates me more to put more energy to practice and prepare. very well explained and great content. you earned my subscription. Specially with the weather outside when you feel sleepy and dull and cant read more than a page, this is a must watch channel for anyone who is preparing for interviews in this season. Don't change your style :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
will do
@giannizamora7247
@giannizamora7247 2 жыл бұрын
I'm about a month into my DS&A study and so many data structures and principles just clicked. Thank you for this!!!
@srijaanand2793
@srijaanand2793 3 жыл бұрын
Cannot appreciate enough how well you explain the problem, and not just read out the problem statement and code! Sometimes just understanding the code is required but often I need an in-depth understanding of the question and what was the thought process etc. Whenever I come across a question like that, I just hope that you would have made a video on it and come to your channel :)
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure, and great to hear
@xxiinsanexx
@xxiinsanexx 3 жыл бұрын
very very well done. explanations on point. i was asked this question during an interview. got hash table but never remembered doubly linked list. now im quite sure im going to remember it for life. thanks once again mate!
@lings628
@lings628 4 жыл бұрын
Your channel is brilliant. I love it so much that I told all my friends about this channel. The clarity in your explanation filled with the energy and passion to teach is just fantastic 🙌
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@sddhrtha
@sddhrtha 5 жыл бұрын
I have my campus recruitment in a month, and your entire channel is on my revision list. Dude, I can't thank you enough for making these high-quality videos.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
yw, go get the offer now! haha, u can do it
@zummotv1013
@zummotv1013 4 жыл бұрын
DataStructure and Algo group on WhatsApp.Please Join chat.whatsapp.com/GKVxU5dvU1e3v7h9ctDpXn
@ninja3514
@ninja3514 3 жыл бұрын
u Got a Job now?
@amansinhparmar3336
@amansinhparmar3336 4 жыл бұрын
Thanks man, i literally spent 3 hours on this and finally get after watching this
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
excellent!
@cambeeler6374
@cambeeler6374 4 жыл бұрын
Thank you! The way you break-down the problem, and then explain your thinking, really helps me to identify the pattern and approach to thinking around the problem for myself. I really appreciate your investment of time and energy !
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@zahranajib5528
@zahranajib5528 2 жыл бұрын
Your energy and spirit is unmatched. Love ya man
@keshavrastogi5005
@keshavrastogi5005 4 жыл бұрын
I have not seen such a great explanation and code. You are just awesome man. God bless you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks, if you liked this join our class, I'll be doing more explanations like this there
@EcheChanga
@EcheChanga 3 жыл бұрын
Didn't understand this problem until I watched n I been looking at it for days Bless you brother.....and the energy made this so dope
@sagarrajput7172
@sagarrajput7172 4 жыл бұрын
You are really good at what you do. It is rare to find genuine smartness and passion in same place. You should be proud of yourself. And yes humour makes it good too.🔥
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@doruwyl
@doruwyl 5 жыл бұрын
I appreciate a lot your dedication for explaining things to the other people. Well done!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@aayushvrshney
@aayushvrshney 4 жыл бұрын
Best LRU cache explanation on whole KZbin!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@manishasharma2863
@manishasharma2863 4 жыл бұрын
I am your Fan! No one can explain this with such simplicity. Thanks a ton! :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@anssha2643
@anssha2643 5 жыл бұрын
You are the best at what you are doing. Love the way you explain and makes things so easy. Its kind of motivating to me. Looking forward to more of your videos. God bless you.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thanks
@randomguy-ew6ez
@randomguy-ew6ez 5 жыл бұрын
Another awesome video. I like the screaming to be honest. I was hyped throughout the video.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hahahaha ok, good to know
@8Trails50
@8Trails50 5 жыл бұрын
mans are yelling CS. good shit
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
@@8Trails50 I know: backtobackswe.com/im-sorry
@edgarsanmartinjr.4278
@edgarsanmartinjr.4278 3 жыл бұрын
His excitement was contagious. LETS IMPLEMENT A LRU CACHE
@danni6113
@danni6113 5 жыл бұрын
This channel is so underrated. Great work!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
wassup
@victorkung8922
@victorkung8922 2 ай бұрын
Been watching many tutorial resource these days. This is the best video. Wish I've seen this in the beginning and saved a lot of my time watching others.
@seymour_videos
@seymour_videos 3 жыл бұрын
i legit love his videos because of his sheer excitement and enthusiasm
@snowing906
@snowing906 5 жыл бұрын
Wow how is this channel so underrated. I feel like I found hidden treasure and I want others to also find it...
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Let's add to the treasure.
@yuxinshi2098
@yuxinshi2098 5 жыл бұрын
Really helpful! You made this question simple and easier to understand, love the graph!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Everything can be made clear with the proper instruction. I am trying to get better at teaching daily. It is very hard. Thank you for watching.
@riskyferyansyahpribadi6984
@riskyferyansyahpribadi6984 3 жыл бұрын
a very detailed explanation and easy to understand, thank you Back to Back SWE
@user-ee5rl7wv8l
@user-ee5rl7wv8l 4 жыл бұрын
Your videos are always the best, so clear, thank you~!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@deeptigaur
@deeptigaur 4 жыл бұрын
Such a great tutorial on cache implementation ! Thanks for sharing 👏🏻👏🏻
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@FrootNinja
@FrootNinja 4 жыл бұрын
first video watched, the fact you left it at sooo i'm hungry then left was dope. smashed that like button and subbed
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hha thx
@kevin-lg3hs
@kevin-lg3hs 4 жыл бұрын
There's always a Back To Back SWE video to explain the leetcode problem that confused me. Thanks!!!!!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha
@zummotv1013
@zummotv1013 4 жыл бұрын
DataStructure and Algo group on WhatsApp.Please Join chat.whatsapp.com/GKVxU5dvU1e3v7h9ctDpXn
@wadichemkhi
@wadichemkhi 4 жыл бұрын
insane level of energy
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lol, old video, I was crazy. Still am.
@ravikanthreddy89
@ravikanthreddy89 4 жыл бұрын
insane energy levels !! and nice editing/tranisitions in the algo tracing out. Liked it.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
I had a bad mic, sorry
@karankanojiya7672
@karankanojiya7672 3 жыл бұрын
Teaching is an art, certainly mastered by this man! Respect++
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thx
@TheRadistOne
@TheRadistOne 4 жыл бұрын
Thank you, my guy! This was so clear & I love the ENERGY!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@ganeshchandrameesala257
@ganeshchandrameesala257 3 жыл бұрын
@@BackToBackSWE where is the code, I couldn't find it in the description
@keshavsethi1610
@keshavsethi1610 4 жыл бұрын
thanks, man one of the neatest and most crisp explanation's I have heard
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@lugiadark21
@lugiadark21 3 жыл бұрын
Bro your channel is underrated, your explanations are the best
@kamaboko1
@kamaboko1 4 жыл бұрын
Dude, you're a rock star. An explanation that made sense.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
nice
@ReneeSLiu-zx5tj
@ReneeSLiu-zx5tj 5 жыл бұрын
I appreciate your thought-process sharing!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@abcdeereijgfhd3215
@abcdeereijgfhd3215 2 жыл бұрын
Holy shoot~! I 've never thought about a double-linked list on this. Thank you for your clarification.
@yasmineelezaby5197
@yasmineelezaby5197 2 жыл бұрын
WOW! that's the most clear and easy explanation for this problem. Thanks!
@dance2die
@dance2die 2 жыл бұрын
Love the explanations and edits!
@sarahm5750
@sarahm5750 Жыл бұрын
Great video and insightful, also love your energy!!
@paulonteri
@paulonteri 3 жыл бұрын
The Greatest Explanation i've found... Please do more leeetcode.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
thx
@architgoyal2336
@architgoyal2336 5 жыл бұрын
I am new to your channel and this is a great channel. Loved the enthusiasm. Subscribed
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@TKNinja007
@TKNinja007 2 жыл бұрын
Great video, I love how you spent the entire video breaking down the concepts instead of showing any code.
@BackToBackSWE
@BackToBackSWE 2 жыл бұрын
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@poojaguru2516
@poojaguru2516 4 жыл бұрын
Please make more videos Ben coz I'm just surviving by learning through Your videos!! Best explanation :) All of your videos are great! You are an inspiration :) keep doing more videos !! Thanks a ton!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
haha nice. I'm starting a class soon. I'll be making 3-4 vids a day w/ Chris Jereza. It'll be good.
@poojaguru2516
@poojaguru2516 4 жыл бұрын
Waiting 😋😋
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@poojaguru2516 haha
@vm1662
@vm1662 5 жыл бұрын
Great explanation! Also, the code is very clear. Really appreciate it. :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@hz3600
@hz3600 3 жыл бұрын
love your energy, very engaging, and this was a very useful video. Thank you so much!
@amarajavijayakumar938
@amarajavijayakumar938 2 жыл бұрын
are u able to see the code on the description?
@shivakrishna7293
@shivakrishna7293 4 жыл бұрын
I think u r not an employee u r a perfect teacher i have seen very few people like you sir awesome
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok lol
@anupkulkarni1703
@anupkulkarni1703 5 жыл бұрын
Good Job Mate! Subscribed to the channel!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
love.
@pulkitagrawal5054
@pulkitagrawal5054 4 жыл бұрын
Wonderful Explanation !! Great work Dude !! Keep making such videos !
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@asishsandhya
@asishsandhya 5 жыл бұрын
Great video dude..You made the problem so simpler. Thanks for that. I just subscribed to your channel.. yayyy
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure, welcome to the party
@r1jsheth
@r1jsheth 5 жыл бұрын
This was one hell of explanation! Many thanks.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Haha sure
@tashifhoda2414
@tashifhoda2414 4 жыл бұрын
Really nice explanation. I was able to implement it with STL on my own!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
great!!
@kumarprateek1279
@kumarprateek1279 5 жыл бұрын
Really good implementation and loved your thought process.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thx
@zummotv1013
@zummotv1013 4 жыл бұрын
DataStructure and Algo group on WhatsApp.Please Join chat.whatsapp.com/GKVxU5dvU1e3v7h9ctDpXn
@Nampjg
@Nampjg 4 жыл бұрын
Loved your energy man!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@madhurapattekar5815
@madhurapattekar5815 5 жыл бұрын
Very nice video. Please do more videos on LeetCode Questions. It will be helpful. Thanks!!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Yeah, I have 250 scheduled as of now. Will take me over a year to do but we will see how far I get.
@margeshpatel8456
@margeshpatel8456 4 жыл бұрын
Like the energy and enthusiasm for teaching. Keep up :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thx
@shilinwang2958
@shilinwang2958 2 жыл бұрын
hash table & singly linked list! Thank you, the explanation is really clear.
@perlaz1166
@perlaz1166 4 жыл бұрын
The opening is really cute!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thnaks? lol, this was way back when no one watched this channel
@satheshbm92
@satheshbm92 5 жыл бұрын
Man you are the killer. Binge watching all videos :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Haha. Excellent. Learn. Grow. And dominate the interview.
@saadtajwar2105
@saadtajwar2105 3 жыл бұрын
Amazing videos as always
@xavierelon
@xavierelon 2 жыл бұрын
That intro had me dying 🤣 thanks for the amazing content as always
@BurhanWani1
@BurhanWani1 4 жыл бұрын
Really liked your explanation. It might have also helped to explain how the hash table stores the address (or the objects in case of Object Oriented languages) of each node corresponding to a key. Good stuff overall.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yep
@ayushagrawal258
@ayushagrawal258 4 жыл бұрын
Man you made this problem look so easy 🔥🔥
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
thanks
@ananyaashrivastava2783
@ananyaashrivastava2783 3 жыл бұрын
Wow ! You made the Question little easy to me ,thanks.
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
great to hear
@cleozhang5695
@cleozhang5695 5 жыл бұрын
Nice video!! Dude! Really enjoyed it.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thank you. I appreciate you.
@xiaoruizhou694
@xiaoruizhou694 4 жыл бұрын
very clear explanation! Thank you sir.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ye
@sergebyusajabo2138
@sergebyusajabo2138 3 жыл бұрын
This is a really good explanation. Thank you.
@FrootNinja
@FrootNinja 4 жыл бұрын
Your channel should have subs like josh fluke, tech lead, joma tech & cs dojo. You're amazing bro! like keep this format up please!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ok
@wawwaw7063
@wawwaw7063 4 жыл бұрын
thank you for your video, I came across this problem today and I had no idea how to implement O(1) put method until I see this
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@jkmaksy
@jkmaksy 4 жыл бұрын
Jeez, having MS interview in two days and then this video comes up :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
lol, a prophecy it is
@DennisSmdFreefightTrainer
@DennisSmdFreefightTrainer 4 жыл бұрын
How did you prepare for your MS interview when you didn't even know this problem?
@fl7883
@fl7883 5 жыл бұрын
Thanks! you helped me a lot. very clear explain.
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@LipsaSenapati
@LipsaSenapati 3 жыл бұрын
Thank you for the awesome explanation! Very energetic! Request: It will be very very helpful if you upload a video for the Priority Expiry Cache with python code (probably using 2 heaps and 2 hashmaps works well but I am trying to use an OrderedDict for better performance likely improvement from O(log n)->O(1))
@AShahabov
@AShahabov 2 жыл бұрын
Awesome LRU explanation!
@garimasarangal4811
@garimasarangal4811 3 жыл бұрын
Brilliant Video Thanks so much
@gatorademe
@gatorademe 5 жыл бұрын
Wow, amazing explanation!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@architranjan9
@architranjan9 4 жыл бұрын
Awesome explaination, thank you for making this video :)
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure!
@_battery
@_battery 4 жыл бұрын
This is awesome. Thank you so much!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yw
@airysm
@airysm 5 жыл бұрын
Thank u for making this question seem way less scary lol
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
you are awesome.
@azeeztaiwo2802
@azeeztaiwo2802 4 жыл бұрын
Great explanation, great energy!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@laminendy
@laminendy 3 жыл бұрын
That's an awesome explanation! Thank you!
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure!
@nagarjunprasad
@nagarjunprasad 5 жыл бұрын
Awesome video as always!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
hey
@mshahzaib4195
@mshahzaib4195 Жыл бұрын
Amazing video !!
@ashwinthobbi
@ashwinthobbi 5 жыл бұрын
Love your energy :)
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
fascinating
@marlegagaming1274
@marlegagaming1274 5 жыл бұрын
You deserve more subscribers
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
Thanks!
@contactdi8426
@contactdi8426 3 жыл бұрын
Friend.. this was awesome!!! Thanks a lot :)
@quentinlassalle1321
@quentinlassalle1321 4 жыл бұрын
Awesome explanation, many thanks!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure.
@MrLazini
@MrLazini Жыл бұрын
Very clear explanation, much appreciated :)
@BackToBackSWE
@BackToBackSWE Жыл бұрын
Thank you! Please enjoy a special code from us - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=MrLazini 🎉
@kishantiwari3221
@kishantiwari3221 3 жыл бұрын
Great Explanation...Thankl you
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
sure
@eug_gino
@eug_gino 5 жыл бұрын
incredible, thanks so much brotha
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
sure
@saitejanagam5748
@saitejanagam5748 4 жыл бұрын
Awesome video man
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
ay
@ShaliniNegi24
@ShaliniNegi24 4 жыл бұрын
Thank you and God bless you!
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
sure
@addiegupta
@addiegupta 5 жыл бұрын
Great video as always
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
@JoeWong81
@JoeWong81 4 жыл бұрын
I like your yelling bro it prevents me from falling asleep. nice explanation too
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
hahahaha ok
@FrootNinja
@FrootNinja 4 жыл бұрын
yea it really does help
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
@@FrootNinja haha ok
@Ana-vx5vx
@Ana-vx5vx 3 жыл бұрын
You teach better than my professor. Thanks
@BackToBackSWE
@BackToBackSWE 3 жыл бұрын
ye
@abdoaboganima
@abdoaboganima 3 жыл бұрын
Thanks a lot. You made my day :)
@1point0tennis
@1point0tennis 4 жыл бұрын
I kept getting stuck on how the doubly linked list removal would be O(n) then it clicked when you helped me realize the HashTable value points to the nodes themselves.
@BackToBackSWE
@BackToBackSWE 4 жыл бұрын
yeah, the nodes have unique representations in memory and the hashtable maps those memory addresses.
@ramyasivaraman2383
@ramyasivaraman2383 5 жыл бұрын
Very nice explanation!
@BackToBackSWE
@BackToBackSWE 5 жыл бұрын
thanks
LeetCode 146. LRU Cache (Algorithm Explained)
18:00
Nick White
Рет қаралды 115 М.
DEFINITELY NOT HAPPENING ON MY WATCH! 😒
00:12
Laro Benz
Рет қаралды 31 МЛН
你们会选择哪一辆呢#short #angel #clown
00:20
Super Beauty team
Рет қаралды 50 МЛН
KINDNESS ALWAYS COME BACK
00:59
dednahype
Рет қаралды 137 МЛН
Каха и суп
00:39
К-Media
Рет қаралды 4,2 МЛН
Search A 2D Sorted Matrix - Fundamentals of Search Space Reduction
29:31
Back To Back SWE
Рет қаралды 51 М.
LRU Cache - Twitch Interview Question - Leetcode 146
17:49
NeetCode
Рет қаралды 243 М.
❌ Don't Run Behind 500 LEETCODE Problems ❌ Focus on QPCD
8:31
[Java] Leetcode 146. LRU Cache [Design #1]
16:32
Eric Programming
Рет қаралды 3,9 М.
КРУТОЙ ТЕЛЕФОН
0:16
KINO KAIF
Рет қаралды 4,9 МЛН
Самый дорогой кабель Apple
0:37
Romancev768
Рет қаралды 337 М.
⚡️Супер БЫСТРАЯ Зарядка | Проверка
1:00