C++ STL std::queue a container adaptor | Modern Cpp Series Ep. 132
Вставка
- Опубліковано 14 тра 2023
- ►Full C++ Series Playlist: • The C++ Programming La...
►Find full courses on: courses.mshah.io/
►Join as Member to Support the channel: / @mikeshah
►Lesson Description: In this lesson I will show you a fundamental data structure -- the queue! Queues have two key operations, push and pop in computer science. The Queue is a FIFO (first in, first out) data structure as opposed to the stack which is a LIFO (Last in, First out) data structure. The STL organizes queue such that each operation does exactly one thing, and front, back, push,pop, and empty for example are as they sound. I'll also describe what it means to be a container adaptor, and that the qeue data structure itself enforces a policy, while the underlying data structure has impacts on performance. Finally, I'll describe to you a use case of queue as it's used for handling events.
►UA-cam Channel: / mikeshah
►Please like and subscribe to help the channel!
►Join our free community: courses.mshah.io/communities/... - Наука та технологія
@10:41 Yesss! I really am interested in seeing creating one of those containers from scratch. That'd be a really cool video!
@10:41 Yesss! I really am interested in seeing creating one of those containers from scratch. That'd be a really cool video! and @12:31 and yes. I'd love to see that FIFO queue for concurrent programming!
I deeply value and admire your ongoing efforts and dedication. Currently, I am engrossed in the realm of deep learning and Python-based CNN for my academic pursuits, which regrettably leaves me with limited time to enjoy these videos.
Thank you for your kind words :) These videos aren't going anywhere when the time comes ;)
Could you touch briefly on the efficiency difference between using list vs deque as the base? One would think that a list would make more sense that a deque. A list also has an end iterator, and since we are only adding to the back and removing from the front, shouldn't these be constant time operations?
I will do a wrap-up video :) Short answer is a deque allocates small blocks versus a list whiich is essentially one element (one node) at a time
@@MikeShah 👍
Hi Mike...could you please cover hashmap container too as part of STL lecture series?
Yes, std::unordered_map and std::map are covered 😁
Thanks again!
Cheers!