ycliper

Популярное

Музыка Кино и Анимация Автомобили Животные Спорт Путешествия Игры Юмор

Интересные видео

2025 Сериалы Трейлеры Новости Как сделать Видеоуроки Diy своими руками

Топ запросов

смотреть а4 schoolboy runaway турецкий сериал смотреть мультфильмы эдисон
Скачать

Rust Programming Exercises: LRU Cache

rust

rust lang

rust programming

rust programming language

rust language

leetcode

#rust

rust tutorial

programming exercises

algorithms

algorithms in rust

rust algorithms

reference cycles

handling reference cycles in rust

weak references in rust

weak smart pointers in rust

reference counters

reference counters in rust

smart pointers in rust

smart pointers

lru cache

lru cache in rust

lru

lru in rust

least recently used cache

weak pointers in rust

Автор: Thomas 🏕

Загружено: 2022-05-16

Просмотров: 7749

Описание: In this video we implement an LRU Cache (Least Recently Used) in Rust with a double linked list along side a HashMap. We make use of Smart Pointers (Weak and Reference Counters) to maintain references between nodes and the HashMap. For the LRU cache, we also add the ability to set a capacity and pop least recently used items off of the list.

**Note**:
Because we make use of weak pointers we do not necessarily have to clean up our HashMap when the cache is being used up but it is something should try and implement later by storing the key alongside the node in order to do this. Try updating our implementation to store the key as well and clean up the HashMap whenever the LRU reaches its capacity.

↠ Other Videos to Watch
Double Linked List:    • Rust Programming Exercises: Double Linked ...  
Tree Traversals with Reference Counting and Interior Mutability (in Rust):    • Tree Traversals with Reference Counting an...  
Handling Reference Cycles (in Rust):    • Handling Reference Cycles (in Rust)  

↠ References:
LRU Cache: https://leetcode.com/problems/lru-cache/
HashMap: https://doc.rust-lang.org/std/collect...
Double Linked List: https://en.wikipedia.org/wiki/Doubly_...
alloc::rc::Weak: https://doc.rust-lang.org/nightly/all...
Reference Cycles: https://doc.rust-lang.org/book/ch15-0...
Interior Mutability: https://doc.rust-lang.org/nightly/std...
Reference Counters: https://doc.rust-lang.org/nightly/src...
Drop Trait: https://doc.rust-lang.org/std/ops/tra...
std::cell: https://doc.rust-lang.org/src/core/ce...
Borrow Trait: https://doc.rust-lang.org/std/borrow/...
Pointers: https://manishearth.github.io/blog/20...

↠ Patreon: https://www.patreon.com/nyxtom?fan_la...
↠ Dotfiles: https://github.com/nyxtom/dotfiles
↠ Twitter: @nyxtom   / nyxtom  
↠ Channel:    / nyxtom  

Cheers! 🍻

🦀 #rust #rustlang #rustprogramming #exercises #programming

Не удается загрузить Youtube-плеер. Проверьте блокировку Youtube в вашей сети.
Повторяем попытку...
Rust Programming Exercises: LRU Cache

Поделиться в:

Доступные форматы для скачивания:

Скачать видео

  • Информация по загрузке:

Скачать аудио

Похожие видео

© 2025 ycliper. Все права защищены.



  • Контакты
  • О нас
  • Политика конфиденциальности



Контакты для правообладателей: [email protected]