Design LRU Cache Data Sturcture | LeetCode 146. LRU Cache | Least Recently Used Cache (LRU Cache)

Опубликовано: 01 Январь 1970
на канале: BarikZone
124
3

📝Statement: Design a data structure that follows the constraints of a Least Recently Used (LRU) cache.Implement the LRUCache class: # LRUCache(int capacity) Initialize the LRU cache with positive size capacity.
int get(int key) Return the value of the key if the key exists, otherwise return -1.
void put(int key, int value) Update the value of the key if the key exists. Otherwise, add the key-value pair to the cache. If the number of keys exceeds the capacity from this operation, evict the least recently used key.


Follow up:Could you do get and put in O(1) time complexity?


🛣️Source code: https://github.com/techbarik/LeetCode...

👨‍💻Link to the problem: https://leetcode.com/problems/lru-cache/

🎬LeetCode PlayList:    • LeetCode Solution  

✅️BEST RESOURCES FOR SOFTWARE ENGINEERING PREP
🗺️Cracking The Coding Interview: https://amzn.to/3i5bPkE
🗺️Daily Coding Problem: https://amzn.to/3n3NaAL

✔️EQUIPMENT I USED IN THIS VIDEO:
🎤Microphone: https://amzn.to/2G2xtsI

✴️PRACTICE CODING QUESTIONS
👨‍💻LeetCode: https://leetcode.com/
👨‍💻HackRank: https://www.hackerrank.com/

❇️FREE RESOURCE ONLINE
🟠https://www.geeksforgeeks.org/practic...

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

⭐ Tags ⭐
LeetCode- LeetCode 146. LRU Cache
CS Ninja
Software Engineering
LRU Cache- Least Recently Used Cache (LRU Cache)- Data Structure Design- Design a Data Structure LRU Cache
⭐ Hashtags ⭐
#leetcode

Disclosure: Some links are affiliate links to products. I may receive a small commission for purchases made through these links. #csninja


Смотрите видео Design LRU Cache Data Sturcture | LeetCode 146. LRU Cache | Least Recently Used Cache (LRU Cache) онлайн без регистрации, длительностью часов минут секунд в хорошем качестве. Это видео добавил пользователь BarikZone 01 Январь 1970, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 124 раз и оно понравилось 3 людям.