Implement LRU Cache | Leetcode

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2024
  • Check our Website:
    In case you are thinking to buy courses, please check below:
    Link to get 20% additional Discount at Coding Ninjas: bit.ly/3wE5aHx
    Code "takeuforward" for 15% off at GFG: practice.geeks...
    Code "takeuforward" for 20% off on sys-design: get.interviewr...?_aff=takeuforward
    Crypto, I use the Wazirx app: wazirx.com/inv...
    Take 750 rs free Amazon Stock from me: indmoney.oneli...
    Earn 100 rs by making a Grow Account for investing: app.groww.in/v...
    Linkedin/Instagram/Telegram: linktr.ee/take...
    ---------------------------------------------------------------------------------------------------------------------------------------------------- SDE sheet: bit.ly/takeUfor...
    Code Implementation Video: • Implement LRU Cache | ...
    ✅Use coupon-code "TAKEUFORWARD" for getting 15% for all CN courses: aff.codingninj...
    Watch at 1.25x for better experience ..
    ---------------------------------------------------------------------------------------------------------------------------
    Problem Link: leetcode.com/p...
    C++: github.com/str...
    Java: github.com/str...
    ---------------------------------------------------------------------------------------------------------------------------
    ✅Use coupon-code "TAKEUFORWARD" for getting 10% for all GFG courses: bit.ly/tuf_gfgC...
    ✅Please Please SUBSKRIIIBEEEEE the new channel: / @striver_79
    ---------------------------------------------------------------------------------------------------------------------------
    ✅Placement Series: • Let's give back to the...
    ✅Placement Series (Arrays, Sorting..): • C++ and Java |Brute-Be...
    ✅Hashing Playlist: • Two Sum Problem | Leet...
    ✅Greedy Playlist: • N meetings In One Room...
    ✅Recursion Playlist: • L8. Combination Sum | ...
    ✅Graph Playlist: • 3 MAJOR ANNOUNCEMENTS ...
    ✅Two Pointer Playlist: • 3 SUM | Brute | Better...
    ✅Binary Search Playlist: • Nth Root of a Number U...
    ✅LinkedList Playlist: • Reverse a Linked List ...
    ✅Advanced DS playlist: • Fenwick Tree Tutorial ...
    ✅Stack&Queue Playlist: • Implementation of Stac...
    ✅Greedy Algorithms: • N meetings In One Room...
    ---------------------------------------------------------------------------------------------------------------------------
    If you appreciate the channel's work, you can join the family: bit.ly/joinFam...
    ✅Thumbnail Creator: / rikonakhuli
    ✅ Striver's Linkedin Profile: / ​
    ✅ Instagram: / ​
    ✅Connect with us: www.google.com... (Use Link in Mobile only, if not works search "takeUforward" in telegram)..
    #dsa​ #striver #leetcode

ความคิดเห็น • 232

  • @takeUforward
    @takeUforward  3 ปีที่แล้ว +62

    DSA Playlists in the comment section ..

    • @AdityaPrakashSinha
      @AdityaPrakashSinha 3 ปีที่แล้ว +2

      Please make a video on BCA Students... Roadmap for off campus placement...

    • @AmanKumarSinhaOfficial
      @AmanKumarSinhaOfficial 3 ปีที่แล้ว

      @@AdityaPrakashSinha yes....

    • @gamingfingers4523
      @gamingfingers4523 3 ปีที่แล้ว +5

      @@AdityaPrakashSinha Bruh it's extremely difficult to get a SDE in a product based company by only having BCA try doing MCA yours odds will increase.

    • @manaswitadatta
      @manaswitadatta 3 ปีที่แล้ว

      Any chance of top interview question series from LC?

  • @tulika2863
    @tulika2863 3 ปีที่แล้ว +120

    For some questions even if I have solved the question previously, I do watch your video for crystal clear explanation. Such an amazing teacher you are bhaiya .

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +11

      Thankyou

    • @Gear5-Luffy
      @Gear5-Luffy 11 หลายเดือนก่อน +1

      @@takeUforward thankyou ki kya baat ,ye to mera farj hai

    • @ipizza9941
      @ipizza9941 3 หลายเดือนก่อน +5

      @@Gear5-Luffy acha bkl

  • @swaroopchakraborty3488
    @swaroopchakraborty3488 ปีที่แล้ว +32

    One of the finest explanations of LRU Cache. God bless you Striver and more power to you. Such impeccable energy and knowledge of data structures is rarely seen at tandem.

    • @aysams2
      @aysams2 ปีที่แล้ว

      +++

  • @ankushrai3155
    @ankushrai3155 2 ปีที่แล้ว +15

    This course have saved my life. thank you so much. i would have never built confidence in solving problems if it wasn't for u

  • @binod3204
    @binod3204 3 ปีที่แล้ว +57

    That much energy you put, motivating me to stay awake and study. Thanks 💖

  • @anuraggoswami3534
    @anuraggoswami3534 3 ปีที่แล้ว +68

    That "just is case" has saperate feeling 💻😂

  • @eldarzakirov5571
    @eldarzakirov5571 ปีที่แล้ว +13

    Great explanation, the only note for (11:23) is that repositioning node in doubly linked list doesn't necessarily require deleting node and creating a new one, it may be enough to update the node (and its neighbors) pointers, thereby preserving address of the node unchanged.

    • @devanshbhatt7609
      @devanshbhatt7609 ปีที่แล้ว

      Yeah I was thit the same but still not sure if we can do that in all possible edge cases

    • @aaaaz424
      @aaaaz424 ปีที่แล้ว

      That was my first thought as well. I just dont understand when to use DLL in a problem.

    • @Anythiny
      @Anythiny ปีที่แล้ว +2

      @@aaaaz424 when u hv to do insertion or deletion in middle of the list. in O(1) time(provided we know where our node is)

    • @sudhanshusingh-cy9wp
      @sudhanshusingh-cy9wp ปีที่แล้ว +1

      I dont think, this is going to work, since if you just change the address, you will also need to shift all the next nodes from head, that will take O(n) time

  • @saptarshidas488
    @saptarshidas488 2 ปีที่แล้ว +9

    This video helped me clear 2nd technical round and eventually get placed at a dream company that came to our college 2 days ago.
    Thank you so much for making such quality content!

  • @masterroyjones4228
    @masterroyjones4228 2 ปีที่แล้ว +26

    If take you forward was not created i would have been literally aiming for 3.5 pkg but because of take you forward i got my concepts cleared and ready to be at product based company with a lot of confidence💯Thanks Striver Bhai✌️🙏

    • @utkarshsharma6650
      @utkarshsharma6650 2 ปีที่แล้ว +5

      did you get placed?

    • @namangupta414
      @namangupta414 ปีที่แล้ว +1

      No reply it means it's fake😂

    • @codingalley6229
      @codingalley6229 8 หลายเดือนก่อน

      bhai sabko notification nahi jata, bc kitne negative ho@@namangupta414

  • @ayanSaha13291
    @ayanSaha13291 9 หลายเดือนก่อน +1

    Brother, I envy your enthusiasm while teaching. Great video. Thanks a lot.

  • @ayushbisht2689
    @ayushbisht2689 3 ปีที่แล้ว +14

    Your energy 💯.

  • @sayanganguly4806
    @sayanganguly4806 2 ปีที่แล้ว +1

    if you are facing TLE, change the get function like below.
    int get(int _key) {
    if(ump.find(_key)!=ump.end()){
    node* resnode=ump[_key];
    int res=resnode->val;
    resnode->prev->next=resnode->next;
    resnode->next->prev=resnode->prev;
    addnode(new node(_key,res));
    ump[_key]=head->next;
    delete(resnode);
    return res;
    }
    return -1;
    }

  • @sagnikmitra710
    @sagnikmitra710 3 ปีที่แล้ว +8

    Next level explanation dada

  • @jeevan-23
    @jeevan-23 7 หลายเดือนก่อน

    striver did you even thought that you would get so much love from students all over India , from working at google, to giving best content, reaching 500k subs, hatsoff man❤❤

  • @sanatbhalla8537
    @sanatbhalla8537 ปีที่แล้ว +1

    Why are we deleting the nodes and creating new ones when they shift? We can just manipulate the pointers (prev & next) such that the same node in the memory is pointed to by the head (ie is the first element). Open to suggestions but I think that is a solid way to not modify the hashmap on get operations.

  • @ankursharma6084
    @ankursharma6084 3 ปีที่แล้ว +8

    At first i thought whiteboard is too old school. It might be boring. But after seeing the whole video .I definitely can see your energy level is much higher and thus it becomes more lively and easy to understand. So in short it seems that this style od teaching turns out to be awesome.

  • @nithishd6420
    @nithishd6420 3 ปีที่แล้ว +3

    The enthusiasm was on different level💯

  • @yogeshedekar6078
    @yogeshedekar6078 8 หลายเดือนก่อน +1

    For maintaining the order can we not just change the links so that head.next becomes the node that is getting used and the next for that node and prev are adjusted accordingly ? Why to delete the node and add a new one ?

  • @piyusht20
    @piyusht20 2 ปีที่แล้ว +12

    Do we really need to update the address in Hashmap when moving the node to the front? I believe we could just re-adjust the pointers of the existing node. that way there is no need to update the map while updating the frequency. node address remains same.

    • @bikrantjajware6062
      @bikrantjajware6062 2 ปีที่แล้ว +3

      same doubt , i think its not necessary to delete the node

    • @dhanesh.s
      @dhanesh.s 2 ปีที่แล้ว

      It will take O(n) time to search the node
      Right?

    • @adityabalodi1185
      @adityabalodi1185 2 ปีที่แล้ว +3

      @@dhanesh.s No, you already have the node in hashmap so it will be O(1). So you just use some temp variables and change the previous of the node being accessed(say, currenr) to next of current, and head's next pointer to current. Then you change curr.next to whatever head.next was previously. And obviously maintain the previous of all the nodes.

  • @sugun6875
    @sugun6875 6 หลายเดือนก่อน

    Great video! thanks. However, the address of the node wouldn't change after deletion. We are just changing the pointers of the nodes in the DLL.

  • @bookalicious9849
    @bookalicious9849 3 ปีที่แล้ว +2

    Thank You for your explaination videos bhaiya !! Cannot find better explanation than yours in web !!

  • @stith_pragya
    @stith_pragya 4 หลายเดือนก่อน +1

    UNDERSTOOD.............Thank You So Much for this wonderful video................🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻🙏🏻

  • @adityaathiratha6104
    @adityaathiratha6104 3 ปีที่แล้ว +2

    bro ...Apart from DSA , one cute suggestion from ur Die hard fan....Besides lower beard , also grow mustache, Dont cut mustache , let it grow densely.. only then lower beard suits perfectly :-) Love u loads.

  • @rajeshg3570
    @rajeshg3570 2 ปีที่แล้ว +4

    Nice video, I've a question here - For the operation . get(3), you are trying to delete the entry from the middle of the DLL and insert at the front if my understanding is correct. If that's true, my question is- the time complexity of deleting a node from the middle of a DLL is not 0(1), right?

    • @Saurabh-lb1uv
      @Saurabh-lb1uv 2 ปีที่แล้ว +1

      It is O(1) only.
      Using hashmap we know the address of the middle node,
      Say it's address is x
      Then all we have to do is:
      x -> prev -> next = x -> next;
      x -> next -> prev = x -> prev;
      delete x;
      This will remove the node from the DLL.
      That means it takes O(1) time for deletion.

    • @rajeshg3570
      @rajeshg3570 ปีที่แล้ว

      @@Saurabh-lb1uv thanks for the clarification

  • @aakashyadav6228
    @aakashyadav6228 3 ปีที่แล้ว +1

    Congratulations on 100k bhaiya !!

  • @viswanathank2551
    @viswanathank2551 3 ปีที่แล้ว +2

    Love u 3000 man best content for programming in earth !

  • @gauravm1253
    @gauravm1253 2 ปีที่แล้ว +1

    So much energy for teaching bro. Amazing

  • @jayadubey_22
    @jayadubey_22 3 ปีที่แล้ว +1

    Congratulations for 100K subscribers takeUforward truly deserve this and more 🙌

  • @original_gangsta_
    @original_gangsta_ 3 ปีที่แล้ว +3

    OP explanation and energy 👌👌👌🔥🔥🔥

  • @mousumikundu2680
    @mousumikundu2680 2 ปีที่แล้ว

    Your explanation is superb. How beautifully you explain each and every step. Thank you so much bhaiya,

  • @vaibhavagarwal1479
    @vaibhavagarwal1479 3 หลายเดือนก่อน +1

    Why is this question marked as a stack/queue question in your sheet?? neither stack nor queue is used?

  • @shreyasingh542
    @shreyasingh542 3 ปีที่แล้ว

    "This guy" Best explaination one could find over web!

  • @jayeshsuthar5590
    @jayeshsuthar5590 ปีที่แล้ว

    Yesterday I was doing SDE sheet 2, completed stack part-1 & missed doing part 2. Today had interview in one of the best startubs in Bangalore & was asked to design LRUcache (couldn't do completely)

  • @amitarya4894
    @amitarya4894 2 ปีที่แล้ว +1

    Great bhai..🙏🙏

  • @webdesignersandip7469
    @webdesignersandip7469 9 หลายเดือนก่อน

    Really appreciate your passion you put in explaining....

  • @baap6382
    @baap6382 2 ปีที่แล้ว

    You are a saviour. You achieve all the success in the world

  • @sukhpreetsingh5200
    @sukhpreetsingh5200 ปีที่แล้ว +1

    Love the way u explain😍😍

  • @विशालकुमार-छ7त
    @विशालकुमार-छ7त 3 ปีที่แล้ว +3

    from functools import lru_cache
    But well explained 👍👍

  • @wisdomkhan
    @wisdomkhan 2 ปีที่แล้ว +1

    Why was this given in Stack and Queues section in SDE sheet?

  • @paragroy5359
    @paragroy5359 3 ปีที่แล้ว +1

    Nice explanation your videos are really good...please keep on making such videos.

  • @saurabhtrigunayat4071
    @saurabhtrigunayat4071 ปีที่แล้ว +1

    we can also solve this question easily using combination of (HashMap+LinkedHashMap) in java.

  • @shuvbhowmickbestin
    @shuvbhowmickbestin ปีที่แล้ว

    one question, if a node already exists and we are asked to update it, why are we updating the node address in the hashmap since if you observe carefully then only the links and the data of the nodes are changing, the address/reference of the nodes themselves are not changing.

  • @sagartaak4017
    @sagartaak4017 ปีที่แล้ว

    best ever explanation as always !!
    even I who always try to skip this topic whenever cover up the queue this time watch only concep and implement it on leetcode and after one minor error it works fine BOOST MY CONFIDENCE

  • @anonymousvoid6356
    @anonymousvoid6356 2 ปีที่แล้ว +2

    striver is on fire in this video. 🔥🔥🔥🔥

  • @jeet-smokey
    @jeet-smokey 2 ปีที่แล้ว

    One of the finest of explanation. Kudos to you for your efforts.

  • @harshalgarg1149
    @harshalgarg1149 3 ปีที่แล้ว +2

    Amazing explanation.

  • @aakashtiwari9505
    @aakashtiwari9505 3 ปีที่แล้ว +2

    Bahut time se koshish kr rha tha lru ko implement krne ki finnally aapne kra diya
    1st like and comment

  • @jayeshl5968
    @jayeshl5968 3 ปีที่แล้ว +1

    perfect explanation broo...ur doing great

  • @nexonsensei3793
    @nexonsensei3793 5 หลายเดือนก่อน

    Really great explanation👏

  • @codespace747
    @codespace747 3 ปีที่แล้ว +1

    Your videos is awesome♥️

  • @akanshapanchal7107
    @akanshapanchal7107 3 ปีที่แล้ว +1

    What a nice way of explanation! More power to you :)

  • @divyam69
    @divyam69 ปีที่แล้ว

    One of the best explanation

  • @sakshamkapoor5905
    @sakshamkapoor5905 3 ปีที่แล้ว +1

    Thank you for this, beautifully explained ❤

  • @deyanpetrov4447
    @deyanpetrov4447 ปีที่แล้ว

    Best explanation I've seen yet, earned yourself a sub

  • @karthiksharma8720
    @karthiksharma8720 3 ปีที่แล้ว +1

    such a great explanation bro

  • @kunalverma9777
    @kunalverma9777 3 ปีที่แล้ว +1

    when we are performing get() operation and we are shifting that right after head as it is most recently used. But I am not getting the point of changing addresses of same node coz we are just connecting it at other place but in memory it will be saved at the previous address only. Please clear my doubt...

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว

      Yes you can improve that point for sure.

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว

      Yes you can improve that point for sure.

    • @kunalverma9777
      @kunalverma9777 3 ปีที่แล้ว

      @@takeUforward Thankyou bhaiya

  • @adityajain1205
    @adityajain1205 3 ปีที่แล้ว +6

    great explanation as always....but cant we implement using a doubly ended queue(dequeue) ? it will be much easier and will take lesser space

    • @TheAnandsingh111
      @TheAnandsingh111 3 ปีที่แล้ว +2

      If you use a queue how will you get an element which is somewhere in between?...it will take more than O(1) time

    • @mohdhammadsiddiqui7598
      @mohdhammadsiddiqui7598 2 ปีที่แล้ว

      @@TheAnandsingh111 i think using hashmap we can find , queue + hasmap will it work?

    • @TheAnandsingh111
      @TheAnandsingh111 2 ปีที่แล้ว +2

      @@mohdhammadsiddiqui7598 if you use another hashmap for storing addresses of elements in queue...then it can he done. But time complexity will become O(n) for deleting any element. Because queue does not supports removing an element from between.

    • @mohdhammadsiddiqui7598
      @mohdhammadsiddiqui7598 2 ปีที่แล้ว +2

      @@TheAnandsingh111 ohh shit, u are right we can't delete in between elements , now i understood why we use link list because we can rearrange the nodes and their links

    • @TheAnandsingh111
      @TheAnandsingh111 2 ปีที่แล้ว

      @@mohdhammadsiddiqui7598 cool 🙌

  • @tusharnain6652
    @tusharnain6652 2 ปีที่แล้ว +1

    Let's check out the C++ and Java Code, "Whenever your heart is broken"

  • @kushwanthkapa2041
    @kushwanthkapa2041 2 ปีที่แล้ว

    We can directly store the value in hash map instead of DLL then also it is same right?

  • @darkstudio3170
    @darkstudio3170 2 ปีที่แล้ว

    10:19 "it does" hit me hard

  • @dheerajmaurya3418
    @dheerajmaurya3418 3 ปีที่แล้ว +2

    Can I use queue data structure instead of DLL??

    • @pankajarora8263
      @pankajarora8263 2 ปีที่แล้ว

      Same doubt because in sde sheet also this question has been included in queue topic and in gfg also queue is included in topic tags.

  • @swapnanilgupta3046
    @swapnanilgupta3046 3 ปีที่แล้ว +1

    Such a great explanation

  • @shubhambhadra5370
    @shubhambhadra5370 7 หลายเดือนก่อน

    Awesome explanation ❤❤

  • @igaming_
    @igaming_ 2 ปีที่แล้ว

    Thanks for your Efforts

  • @deepikasahu1592
    @deepikasahu1592 ปีที่แล้ว

    Best explanation so far🙌

  • @therealg9542
    @therealg9542 ปีที่แล้ว

    I ended up solving the question by utilizing the dictionary (hashmap) and doubly linked list data structures. However, I did not know you could solve it easily using an ordered dictionary in Python. Nevertheless, great explanation!

  • @NAVEENKUMAR-ch4gf
    @NAVEENKUMAR-ch4gf 3 ปีที่แล้ว +1

    amazing explanation!!!!!

  • @vipsclassicalboy
    @vipsclassicalboy 2 ปีที่แล้ว

    your energy is the awesome, keep it up bro..

  • @ayushshukla2103
    @ayushshukla2103 2 ปีที่แล้ว

    Amazing explanation. Thank you.

  • @shimul6680
    @shimul6680 2 ปีที่แล้ว

    You are a great genius....

  • @susankamajumder9859
    @susankamajumder9859 3 ปีที่แล้ว +2

    at step 4 of the dry run (i.e put(3,3) ) shouldn't the least recently used value be {1,1} ? why are we replacing {2,2} then ?

    • @takeUforward
      @takeUforward  3 ปีที่แล้ว +3

      Get(1) was done na… before that..

    • @susankamajumder9859
      @susankamajumder9859 3 ปีที่แล้ว +1

      @@takeUforward yes , now it got it. Thank you.

  • @SahilAhuja-hy9gg
    @SahilAhuja-hy9gg ปีที่แล้ว

    best explanation this ques could ever have

  • @AbhinavSrivastava-xr5jz
    @AbhinavSrivastava-xr5jz ปีที่แล้ว

    the finesse of a Google engineer 😍🤩

  • @akashchaudhury3240
    @akashchaudhury3240 4 หลายเดือนก่อน

    Nice explanation 🔥

  • @aasthajha1051
    @aasthajha1051 3 ปีที่แล้ว +1

    awesome...................

  • @shivammehta9661
    @shivammehta9661 3 ปีที่แล้ว

    Very Nice Explanation....Keep making videos

  • @bhaveshkumar6842
    @bhaveshkumar6842 2 ปีที่แล้ว

    You explain soooo well!

  • @Anurag-kp6wc
    @Anurag-kp6wc 2 ปีที่แล้ว

    Thanks Bhaiya! You're the best :D

  • @piyushkumar2437
    @piyushkumar2437 ปีที่แล้ว

    Why you have used Doubly LinkedList. Why not use singly linked list and maintain pointers pointing to start and rear. Please advise.

  • @ManishaKumari-lp4kw
    @ManishaKumari-lp4kw 2 ปีที่แล้ว

    Explanation and Energy !!!!💯🔥

  • @muskangupta5873
    @muskangupta5873 3 ปีที่แล้ว

    big thanks bhaiya.. such a nice explanation🤩

  • @varunsingh6480
    @varunsingh6480 3 ปีที่แล้ว

    How we maintain the min freq in O(1). I mean how we find which is the current least frequency and how we change the Least frequency during get and put can you explain that logic as well ?

    • @narendranarumugavadivelu8648
      @narendranarumugavadivelu8648 2 ปีที่แล้ว

      You can always insert the latest node at front and LRU node at rear. So when wanted to remove LRU node just point the rear to previous of current rear node

  • @aryansinha1818
    @aryansinha1818 2 ปีที่แล้ว

    *Thank You so much. Love & Respect always.*

  • @amanmotghare7196
    @amanmotghare7196 ปีที่แล้ว

    excellent explanation

  • @sarveshsawant7232
    @sarveshsawant7232 ปีที่แล้ว

    Great video, one question can't we implement the same with singly linked list?

  • @raj_kundalia
    @raj_kundalia ปีที่แล้ว

    thanks for the explanation!

  • @OMPRAKASH-is7fj
    @OMPRAKASH-is7fj ปีที่แล้ว +1

    best u r the best

  • @kbhargavi4400
    @kbhargavi4400 3 ปีที่แล้ว

    truly awesome explaination !! : ) Thank you bro !!

  • @bhaveshkumar6842
    @bhaveshkumar6842 2 ปีที่แล้ว

    You can explain anything. You are a legend!

  • @karma_kar9623
    @karma_kar9623 ปีที่แล้ว

    This type of T shirts will get you bullied in school/college. Great video btw.

  • @jatilyadav4000
    @jatilyadav4000 ปีที่แล้ว

    Thank you soo much Striver @Raj

  • @loveleshsharma5663
    @loveleshsharma5663 2 ปีที่แล้ว

    Good Explanation!

  • @devprakash5320
    @devprakash5320 3 ปีที่แล้ว +1

    amazing video

  • @shivam9048
    @shivam9048 ปีที่แล้ว

    Very well understood

  • @rishabhkumar8115
    @rishabhkumar8115 3 ปีที่แล้ว +1

    Jaan daldi sir apne to

  • @rohandsouza9147
    @rohandsouza9147 3 ปีที่แล้ว

    Cant be thankful enough man !!

  • @devanshmesson2777
    @devanshmesson2777 2 ปีที่แล้ว

    Thank you so much striver!

  • @vishnugandlur3875
    @vishnugandlur3875 ปีที่แล้ว

    searching in an unordered map takes o(N) worst case time right? But requirement was to do it in o(1).

  • @auroshisray9140
    @auroshisray9140 2 ปีที่แล้ว

    Nicely explained

  • @sivrajsubba94
    @sivrajsubba94 2 ปีที่แล้ว

    what if you want to put a key and value into the hashmap but the same key and value is already present in the hashmap?

    • @rohanmahto3123
      @rohanmahto3123 ปีที่แล้ว

      you just change the position of the node after the head as it is the recently used