STL std::list | Modern Cpp Series Ep. 118

  Рет қаралды 3,868

Mike Shah

Mike Shah

Жыл бұрын

►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 give you an introduction to the std::list data structure. Lists are node based data structures using pointers behind the scenes to help you achieve fast insertion and removal at the trade-off of random access.
►KZfaq Channel: / mikeshah
►Please like and subscribe to help the channel!
►Join our free community: courses.mshah.io/communities/...

Пікірлер: 30
@scullyy
@scullyy 5 ай бұрын
I've never had a use for linked lists (yet), but I have a soft spot for them. It was while learning python and creating my own linked list class, that programming finally "clicked" for me. Instead of needing to look at the tutorial and just copy/paste, I could actually create every method on my own. 🙂
@user-vp3fb4we3x
@user-vp3fb4we3x 3 ай бұрын
Keep up the good work Mr Mike this video has been very helpful. Your teaching method is one of the best I have seen on the internet
@MikeShah
@MikeShah 3 ай бұрын
Cheers, thank you!
@thestarinthesky_
@thestarinthesky_ Жыл бұрын
@24:10, i think in the 'merge' operation of a std::list, nodes from one list ( 'other' in this context) are reorganized into another list (list). This is done by adjusting the next and previous pointers of the nodes, rather than moving or copying the data they contain. This makes the merge operation more efficient than similar operations on other data structures, like arrays or vectors. After the merge operation, ' other' no longer contains any nodes. Its internal pointer to its first node (i.e., its "head") is set to nullptr, giving the impression that the list is now empty. In essence, 'other' as a standalone list no longer contains any elements. However, it's important to note that the nodes from 'other' have not been destroyed or removed. Instead, they've been linked into list. This is the beauty of the linked list data structure and the merge operation: it can reorganize data efficiently by manipulating pointers, without the need to physically move or copy the data. That's my understanding of merge in std::list. Thanks for the great video Mike! 👏 I am watching the whole STL series for the second time and learning new thingS.
@MikeShah
@MikeShah Жыл бұрын
Awesome! Yes, linked list can really do some neat things :)
@qcnck2776
@qcnck2776 Жыл бұрын
Thanks much!
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@willofirony
@willofirony 6 ай бұрын
Just a heads uo; Splice can also be used to move an element within a list. Details in cppreference std::list::splice.
@MikeShah
@MikeShah 6 ай бұрын
Neat -- it would be a flaw in the design in my opinion if we could not splice within the same list.
@viliamjr
@viliamjr 3 ай бұрын
Amazing tutorials about STL, very handy!
@MikeShah
@MikeShah 3 ай бұрын
Cheers!
@mehedihassan-pf6yh
@mehedihassan-pf6yh 10 ай бұрын
youre one of the different teacher sir, please show us something that others don't share , like u did in this video
@MikeShah
@MikeShah 10 ай бұрын
Cheers, thank you for the kind words!
@mehedihassan-pf6yh
@mehedihassan-pf6yh 10 ай бұрын
thanks if you touch any topics ,please discuss deeply by showing cpprefferance , and this helps learning when u talk half an hour and show everything inside out.god bless u@@MikeShah
@codigo-nodosyvfx
@codigo-nodosyvfx Жыл бұрын
Great video
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@mehedihassan-pf6yh
@mehedihassan-pf6yh 10 ай бұрын
keep going dont stop mate
@MikeShah
@MikeShah 10 ай бұрын
More on the way 🙂
@VoidloniXaarii
@VoidloniXaarii Жыл бұрын
You're so cool, thanks again
@MikeShah
@MikeShah Жыл бұрын
Cheers!
@VoidloniXaarii
@VoidloniXaarii Жыл бұрын
​@@MikeShahstill learning going thought it again. Thank you for making.. reusable code 😅
@MikeShah
@MikeShah Жыл бұрын
@@VoidloniXaarii cheers! Enjoy!
@Xray_OS
@Xray_OS 3 ай бұрын
my problem is that am a little bit slower typing and understanding those topics, but may be you should consider type a little bit more slower, because repeat what you do and at the same time learn it is difficult if you type so fast
@MikeShah
@MikeShah 3 ай бұрын
Thanks for the feedback! Feel free otherwise to pause or slow down -- definitely no need to race through the videos especially as learning. It does take some iteration, but over time you'll find the STL has similar patterns that make it easier to pick up :)
@thestarinthesky_
@thestarinthesky_ Жыл бұрын
@4:16 When you say as long as we have iterator , this also mean we are having O(i) if i is the position of the list in the std::list object right? it wouldn't be O(1) if we calculate iterator part too.
@MikeShah
@MikeShah Жыл бұрын
Correct, if we have an iterator then we can insert in O(1)
@thestarinthesky_
@thestarinthesky_ Жыл бұрын
@@MikeShah Thank you so much.
@ghulam2545
@ghulam2545 Жыл бұрын
Helpful and informative, thanks for continuing the series. How about having light theme over dark for tutorials.
@MikeShah
@MikeShah Жыл бұрын
Cheers. Will consider that
STL std::forward_list | Modern Cpp Series Ep. 119
29:09
Mike Shah
Рет қаралды 1,6 М.
STL std::deque  | Modern Cpp Series Ep. 120
28:43
Mike Shah
Рет қаралды 2,4 М.
Incredible magic 🤯✨
00:53
America's Got Talent
Рет қаралды 78 МЛН
Heartwarming moment as priest rescues ceremony with kindness #shorts
00:33
Fabiosa Best Lifehacks
Рет қаралды 13 МЛН
孩子多的烦恼?#火影忍者 #家庭 #佐助
00:31
火影忍者一家
Рет қаралды 51 МЛН
98% Cloud Cost Saved By Writing Our Own Database
21:45
ThePrimeTime
Рет қаралды 321 М.
STL std::map  | Modern Cpp Series Ep. 126
36:13
Mike Shah
Рет қаралды 3,1 М.
LinkedList vs ArrayList in Java Tutorial - Which Should You Use?
11:43
Coding with John
Рет қаралды 578 М.
Metal Piece From 1947 Roswell Incident Analyzed By a Government Lab
13:59
Should you learn C++?? | Prime Reacts
20:29
ThePrimeTime
Рет қаралды 331 М.
Что не так с раскладушками? #samsung #fold
0:42
АЙФОН 20 С ФУНКЦИЕЙ ВИДЕНИЯ ОГНЯ
0:59
КиноХост
Рет қаралды 677 М.