Back To Basics: C++ Containers

Ғылым және технология

Containers provided by the standard library in C++ have almost become as essential as the language keywords themselves. Storing data in the correct way will make you a fluid and stronger programmer, as you can let the containers do the hard work for you. In this video I take a really brief look at the main containers std::array, std::vector, std::list, std::deque, std::set, std::unordered_set, std::map, std::unordered_map.
CppCast: cppcast.com/one-lone-coder/
Patreon: / javidx9
KZread: / javidx9
/ javidx9extra
Discord: / discord
Twitter: / javidx9
Twitch: / javidx9
GitHub: www.github.com/onelonecoder
Homepage: www.onelonecoder.com

Пікірлер: 395

  • @javidx9
    @javidx93 жыл бұрын

    I was recently pleasantly surprised to be invited to have a chat with the guys on CppCast! You can listen to how I lowered the tone in general here: cppcast.com/one-lone-coder/ A big thanks to Rob and Jason for giving me the opportunity, they were great guys and it was great fun :D

  • @xXGskillsniperXx

    @xXGskillsniperXx

    3 жыл бұрын

    My favorite c++ youtubers making a podcast == ❤️

  • @20thCB

    @20thCB

    3 жыл бұрын

    I listened to the whole thing! Congratulations on the new arrival :-)

  • @treyquattro

    @treyquattro

    3 жыл бұрын

    massive kudos! Jason is my go-to (no, not goto) resource for keeping up to date with the language. I'll check out the podcast.

  • @samuelcampbell6559

    @samuelcampbell6559

    3 жыл бұрын

    Napping is a thing, podcasts are a thing, coding is a thing and enjoying your videos is also a thing. If only there was a way I could smash all of these pursuits together... There is!

  • @jonedwards3827

    @jonedwards3827

    3 жыл бұрын

    I thought it was a great listen, both on your philosophy towards getting people into coding and very interesting generally on robot work and PhD, congrats too, much appreciated, leaning lots.

  • @anonanon3066
    @anonanon30663 жыл бұрын

    One of my favourite things about your content is that you show that C++, a language generally known to be "complicated and unwieldly", can be one of the most elegant and beautiful languages out there.

  • @fastmovingvolcanomatter

    @fastmovingvolcanomatter

    3 жыл бұрын

    I don't know that "elegant" is the word I'd use to describe the language itself. I think the extreme flexibility afforded by how precise you can be in programming to your exact needs lends itself well to providing opportunities to write elegant code, but the language as a whole isn't elegant I don't think. Like, think about all the duplicate functionality C++ has from C backwards compatibility (mostly to do with pointer and memory management stuff). Or some of the semi-duplicate specifiers like struct and class (only difference is being private vs public by default, both of which already exist as dedicated keywords to serve this exact purpose), or typename and class in template definitions (whose few differences are slowly being removed even now). Then there's template specializations and metaprogramming as a whole, the Concepts spec being introduced in C++20, etc. It's all kind of a mess, really.

  • @x-seronis-x

    @x-seronis-x

    3 жыл бұрын

    All things possess beauty. Its a matter of having the proper perspective

  • @anonanon3066

    @anonanon3066

    3 жыл бұрын

    @@fastmovingvolcanomatter I agree. This whole template thing is one big shit show. You can write a function for arbitrary types, but only if you put the function body in-class. Oh, you want to put the code in the classes .cpp? Now you have to declare beforehand what types T should be, basically removing the point of templates... And now these concepts... Why couldn't I just do template T Add(T a, T b) { return a + b;} and the compiler would reject all instances where T does not have the dependent functions? Like, operator+... Why would I have to write a big mess of template requirements std::is_numeric, etc... All the information is there...

  • @RogueShadowTCN

    @RogueShadowTCN

    3 жыл бұрын

    Don't be fooled! He keeps it on the simple side on purpose!

  • @arielespindola1759

    @arielespindola1759

    3 жыл бұрын

    C++ should be used and seen as a modern language these days... and yes, it is so elegant

  • @chrisroode
    @chrisroode3 жыл бұрын

    I’m a completely self taught programmer, and this video did such a great job at filling in so many gaps! You are a great teacher!

  • @Meskalin_

    @Meskalin_

    3 жыл бұрын

    same!

  • @jakubpluhacek3779

    @jakubpluhacek3779

    3 жыл бұрын

    Go do some codewars and look at people's solutions! They often use so many useful functions/objects from standard library and mostly explain why they do so.

  • @jkligel

    @jkligel

    2 жыл бұрын

    Well stated. Completely agree

  • @happygofishing

    @happygofishing

    9 ай бұрын

    Although im studying networking, ive had no programming education so this is a greatly useful channel!

  • @AMildCaseOfCovid
    @AMildCaseOfCovid3 жыл бұрын

    I had no idea that a vector behaved like a hermit crab searching for larger shells as it grows

  • @MMarcuzzo

    @MMarcuzzo

    3 жыл бұрын

    Me too. That was cool

  • @beskamir5977

    @beskamir5977

    3 жыл бұрын

    Same, I definitely accidentally wrote bugs where I used pointers to vectors that got resized...

  • @javidx9

    @javidx9

    3 жыл бұрын

    It gets worse... When the vector is moved, all that data is just left there, so the pointers still appear valid for a random amount of time!

  • @surters

    @surters

    3 жыл бұрын

    @@javidx9 Usually I get around it by using an index into the vector instead as iterators/references/pointers gets invalidated by relocation.

  • @nextlifeonearth

    @nextlifeonearth

    3 жыл бұрын

    @@javidx9 Sounds ideal to store passwords in for all those buffer overflow gains.

  • @suicidalkids9916
    @suicidalkids99163 жыл бұрын

    Only KZreadr that fully explains super boring cpp concepts and makes it fun.

  • @lozD83

    @lozD83

    3 жыл бұрын

    Or maybe "... fully explains super fun cpp concepts and doesn't make it boring"? ;)

  • @fitstrong167

    @fitstrong167

    3 жыл бұрын

    C++ boring ??? Wtf is wrong with you ...dam boi ...

  • @scharpmeister

    @scharpmeister

    3 жыл бұрын

    @@fitstrong167 wish I had that energy

  • @NatalisYT
    @NatalisYT3 жыл бұрын

    You are truly one of the best teachers of programming and C++ around, we are all very fortunate to have you and I hope you continue to make beginner/intermediate videos like this to help make this nightmarish language more accessable to more people. Another great video, thank you!

  • @javidx9

    @javidx9

    3 жыл бұрын

    Thanks Natalis, I will be occasionally doing more "entry level" videos, but also some of the silly projects too :D

  • @mrgeebee1622

    @mrgeebee1622

    3 жыл бұрын

    I agree, this is really good to watch, and very pedagogic. Thank you Javidx9

  • @DFPercush
    @DFPercush3 жыл бұрын

    Any chance of getting into the C++20 stuff with concepts, coroutines, and piping operators?

  • @irbaboon1979
    @irbaboon19793 жыл бұрын

    I had to learn this from a rudimentary data structures book with shoddy drawings and unsatisfactory input from my teacher in the mid 90’s - your explanations are much clearer. Although I haven’t done C/Cpp for years in my professional career I’m still enjoying the content. Keep it up!

  • @franciscogerardohernandezr4788
    @franciscogerardohernandezr47883 жыл бұрын

    It's pure bliss when a pro coder goes back to explain basics. A C++20 tutorial using your pixel engine would be a beast. Regards and great work!

  • @saudude3209
    @saudude32093 жыл бұрын

    As someone old enough to know how studying programming or just about any other science subjects looks like without youtube or udemy, I never forget to say that videos like this one and creators like you are a treasure. Even though I had successfully defended a cpp project for my engineering thesis, I have still remained at a cpp amateur/intermediate level, because of my laziness and lack of consistency in learning. I appreciate series like "Back To Basics" a lot. Thank you for providing high quality, in-depth lessons for us for free.

  • @ZeroCool2211
    @ZeroCool22113 жыл бұрын

    Man that's exactly what I need currently 👌🏼

  • @pythagorasaurusrex9853
    @pythagorasaurusrex98533 жыл бұрын

    I watched a lot of your c++ videos so far. I have to say: Great job. I learned C++ way back in early 90ies but stopped programming about 20 years ago. Now I started to dig out my old C++ knowledge and re-learn C++ and I see how much C++ has evolved the last 20 years with all those new std:: features. Keep up your quality!

  • @Thinzy
    @Thinzy3 жыл бұрын

    thank you so much for what you've provided us all with. Your explanations make everything so simple to understand

  • @firepro20
    @firepro203 жыл бұрын

    I'm just getting started in C++ and your calm approach encourages me to learn more and not be afraid of the most complex / unforgiving programming language. Thank you and please continue making more videos! :D

  • @nuderedfinger
    @nuderedfinger3 жыл бұрын

    God bless you dude!! I really needed a good video on STL containers, and upon searching "C++ containers", your video was the top result! I actually started learning C++ from your channel a few years ago. Absolutely, the best C++ channel on KZread. Thank you for what you do :) I hope to support you someday in a bigger/better way than just likes and comments haha

  • @TheButcher58
    @TheButcher583 жыл бұрын

    Your videos are really helpful in the sense that they do not provide a basic step by step tutorial how to implement a vector for example, but rather explain the background processes so that you understand why/when to choose a certain container type. I also like the fact that your video subjects are not necessarily related to each other but you pick a certain topic each time. This way you learn a lot of different things each video. Thank you for all the content you provide!

  • @davideriemma180
    @davideriemma1803 жыл бұрын

    The timing of this video is perfect: right when i needed. i feel like this is one of the channel that covers C++ and algorithm on a very detailed and easy to understand way! Thank you so much!

  • @burntt999
    @burntt9992 жыл бұрын

    !!! javid you really are the man!!!! I always wanted to write something like this program in the video but wasn’t sure how to go about it. Now I can go over the program you wrote on this video line by line until I have it ingrained in memory.. jeez this channel is so incredible.

  • @markrobinson2648
    @markrobinson26483 жыл бұрын

    I'm a C# developer who is learning C++ and your videos (particularly this one) are fantastic. Thank you for spending the time to create the videos.

  • @JoshRosario310
    @JoshRosario3103 жыл бұрын

    This is great, I learned C++ in 2005 and never touched it again until 15 years later. I never got into templates and with these containers there was a lot of syntax that made it look to me like a completely different language. I've been trying to find exactly this video with no real luck. I recently learned PHP and VB and thought the concept of a for..each was pretty nifty and wished I knew of a way in C++ back in the day! Great videos, I've been bingeing your content from the beginning over the last month.

  • @arielespindola1759
    @arielespindola17593 жыл бұрын

    It was posted four minutes ago, I haven’t watched it, and I already liked it!

  • @peter881

    @peter881

    3 жыл бұрын

    My respect for people who disliked📉

  • @CodingCardSharp
    @CodingCardSharp3 жыл бұрын

    Thank you for uploading this; it's a really useful resource on my own learning journey! I started C++ from scratch on a part-time basis in Sept 2020, and have basically been beasting arrays (of the 1D and multi-dimensional variety), loops, basic recursion, and some very simple classes/structs since. It was a linear learning process, including working out the 'easier' problem solving exercises. However, the next step up demands more...I dipped my toe in the murky waters of STL, and had it bitten off by some of the coding problems that demand their usage; so it's great to see the containers explained in a manner that sticks ice-cubes down the back of the learning fatigue that had set in. Your channel does for complicated programming concepts what something like 'Grokking Algorithms' did very for the far more elementary.

  • @proud22beme
    @proud22beme3 жыл бұрын

    this video is a godsend! i am self taught, so there is some knowledge gaps, prior to this i have mainly paid attention to time complexity, but the way you explain the memory allocation for each container is so good in this! learned a ton from it

  • @mokoko02
    @mokoko022 жыл бұрын

    Hey just wanted to thank you for explaining these basic concepts in a ...well basic manner :) A lot of people online try to over-complicate things so your style of teaching helps me a lot.

  • @javidx9

    @javidx9

    2 жыл бұрын

    Hey my pleasure buddy!

  • @danieloliveira9815
    @danieloliveira98153 жыл бұрын

    Im a junior web dev and I don't understand most of your videos, but still I don't miss one because the way you explain is so entertaining :D

  • @chiefthebeast9343
    @chiefthebeast93433 жыл бұрын

    Thank you so much! I am teaching myself c++ and I am at vectors and you explained everything I am learning about in this one video!

  • @neefofway8746
    @neefofway87462 жыл бұрын

    I appreciate what you do Javid, I owe everything I know about c++ and programming in general to you. Keep it up brother!

  • @thalescarl1589
    @thalescarl15893 жыл бұрын

    Awesome video. I don't think we can find other content with this much quality on KZread. Please make this a series explaining the basics for us.

  • @mehtubbhai9709
    @mehtubbhai97099 ай бұрын

    Loved your explanation on this topic. Please do more C++ back to basics videos. Good teachers like you are much appreciated. Cheers!

  • @xit1254
    @xit12543 жыл бұрын

    This is the best explanation of these mysterious C++ containers I've run across. I now believe I actually understand them.

  • @abhiz93
    @abhiz933 жыл бұрын

    I had to learn vectors when I started to prepare for interviews. Even the most basic questions couldn't be done without vectors on HackerRank. Thanks for this primer! Much appreciated.

  • @magisteriumemporium1411
    @magisteriumemporium14113 жыл бұрын

    Mr. Beautiful beard man strikes my heart again> THANK YOU FOR THIS. You are in my opinion one of the best, if not the best, people out there for content to watch. Thank you so much for what you have done for the community

  • @felixmerz6229
    @felixmerz62293 жыл бұрын

    This video is such a useful ressource. Immediate classic.

  • @leanderperera8467
    @leanderperera8467 Жыл бұрын

    Excellent overview of C++ containers and their internals and efficiency. Thank you.

  • @brucewayne2480
    @brucewayne24803 жыл бұрын

    Great video ! I studied C++ a little bit at university and now I'm using javascript and typescript. Back to the basics is essential.

  • @archie9500
    @archie95003 жыл бұрын

    Just what I needed when messing around with maps of bucketed linked lists!

  • @ArisAlamanos
    @ArisAlamanos3 жыл бұрын

    Yet another great video from an excellent channel! I admire your dedication and passion. Keep up the good work!

  • @nunyobiznez875

    @nunyobiznez875

    3 жыл бұрын

    Code::Blocks is fairly easy to setup and supports different compilers. It's a good IDE, and it also has tools for wxWidgets as well, which may also come in handy for you at some point as well.

  • @jaitjacob
    @jaitjacob Жыл бұрын

    thank you for making such a comprehensive yet easy to understand video! you are a great teacher.

  • @77Zamien
    @77Zamien2 жыл бұрын

    Great content! I have been learning C++ for a while and this was an excelent summary of the containers!

  • @NormHen5413
    @NormHen54133 жыл бұрын

    These beginner level concepts are super helpful, thanks for posting Javid

  • @yusufklc7821
    @yusufklc78213 жыл бұрын

    A new video about fundamentals. Thx javidx!

  • @robwatson826
    @robwatson8263 жыл бұрын

    That was a really interesting video and great to get some deeper understanding on how these data structures store their values, thanks for sharing!

  • @inlandchris1
    @inlandchris1 Жыл бұрын

    Very good instructions. I use to hand make Link List in the mid 1990's and considered them extremely fast. Now, looks like all the hard work is pre-made making C++ a higher level programming language. I am very late as COVID delayed my programming works as I went to build some muscles instead. Thank you for this and look forward following you.

  • @happyredmapleleaf
    @happyredmapleleaf3 жыл бұрын

    Let’s goooo another video for my skill level XD

  • @scharpmeister
    @scharpmeister3 жыл бұрын

    Amazing. In the midst of losing my mind debugging this vector indexing problem, this just pops up in my recommendations👌🏻

  • @Windeycastle
    @Windeycastle Жыл бұрын

    This was a great video! As a beginner, I've wondered how you should store multiple values in one variable. In Python, it's easy, but in C++ you have to choose what types fits your needs. I like it!

  • @jorgeferreira6727
    @jorgeferreira67273 жыл бұрын

    The "vector" took me by surprise. I really didn't expect it to be moving around so soon. I was watching just to review, as in "dusting out", some concepts, and maybe catching up with something new from the more recent C++ standards, and got kicked in the back by that old std::vector. Thank you for the inside details you show in your videos. After 30+ years there is still something to be learned.

  • @bumbarabun

    @bumbarabun

    2 жыл бұрын

    "I really didn't expect it to be moving around so soon." it is under your control, if you know in advance there would be much more elements - reserve capacity and it will not reallocate.

  • @Finkelfunk
    @Finkelfunk Жыл бұрын

    Can I just say that you are doing a fantastic job teaching these types of complex concepts? :)

  • @seanmenzies1986
    @seanmenzies19862 жыл бұрын

    Fantastic video. "A deque is like a linked list of arrays". Light bulb moment! Thank you so much!

  • @kevinz1991
    @kevinz19913 жыл бұрын

    I appreciate that JAVID9X doesn’t like to “patronize” those who learn from him and appreciate how he empowers the coder to think about how the program runs for him or herself. With that being said... these “Back to basic” videos... especially the pointers tutorial and this containers tutorial... are extremely helpful in understanding even the most basic games on OLC if you are not a C++ wizard. I would highly recommend anyone reading this comment to go watch how the Tetris game is made and how the Tetris blocks are indexed. It makes even some of the most sophisticated games on OLC make sense to me. Anyways hope this helps someone cause I was really frustrated at first trying to learn this stuff, thank you so much javid9x

  • @javidx9

    @javidx9

    3 жыл бұрын

    It's so important to learn how to debug, and the only way to do that is developing an understanding of what goes on behind the scenes. Digging yourself out of a hole is a really important programming skill.

  • @computerprogrammer7942
    @computerprogrammer79423 жыл бұрын

    He made this video at the right time when everybody needed it, what a genius!

  • @arnocr01
    @arnocr01 Жыл бұрын

    more back to basics please! you explain things so well. i wish i had your videos back in college instead of a dry textbook.

  • @KingGrio
    @KingGrio3 жыл бұрын

    Thanks ever so much Javid for this video. I have not been properly trained in C++ and I find a lot of KZread tutorials provide contrived examples that do not really help understand when something is useful. Your videos always provide some context and I always feel like I got a clearer picture of how things work internally and what is and isn't good practice. Although because of my lack of knowledge it does take me a long time viewing your different videos to process all the information and finally "get it". If you ever have some time, I would be tremendously happy if you could break down the VST plugin framework for us. I have a lot of trouble understanding things like "extern C", or how virtual classes are used for versioning or inheritance, or how threads are started somewhere and how/where you should write code to pass your audio data to the plugin and so on.

  • @Artintrex
    @Artintrex3 жыл бұрын

    I already have a good understanding of stl library but still this is the best explanation I've seen so far. Can't help but feel jealous of people learning them from you for the first time. Though I still prefer vector over deque; you can allocate a larger vector beforehand which also causes vector to grow by larger steps, also removing elements by moving the last element to the middle and doing a pop back solves the performance issue. Another tip is these containers do not automatically shrink, so a vector is pretty much just as fast as a regular array as long as you don't cause it to grow again.

  • @thebasicmaterialsproject1892
    @thebasicmaterialsproject18923 жыл бұрын

    Nothing better than a bit of back to basics

  • @benjamink
    @benjamink3 жыл бұрын

    I program in C and hate C++ because it's so complex and has tons of features to learn, but I think after watching this video that it is actually possible. Great explanation and thanks

  • @Djinn667
    @Djinn6672 жыл бұрын

    This was an amazing lecture! Keep up the good work!

  • @TankorSmash
    @TankorSmash3 жыл бұрын

    14:15 to everyone wondering, he called his vector, container not the other way around. Threw me for a loop for a sec

  • @brendinventer6407
    @brendinventer64073 жыл бұрын

    You really need to make a C++ game development course. Your teaching approach is so so good. Thank you!

  • @geraltt1455
    @geraltt14553 жыл бұрын

    like your videos, they have philosophical atmosphere

  • @liamsmith7052
    @liamsmith70523 жыл бұрын

    For me as a .NET developer switching to RAII C family your tutorials are very helpful. Thanks a lot)

  • @n0handles
    @n0handles3 жыл бұрын

    This also was a great review on data structures. Thanks for another great video!

  • @BenKadel
    @BenKadel3 жыл бұрын

    Absolutely epic and brilliantly informative video! Thank you so much!

  • @doriancorr
    @doriancorr8 ай бұрын

    I've been a professional developer since the eighties. Your videos are all top notch. Kudos and I'm already a subscriber but I would have signed up with this one as well. Well done!

  • @javidx9

    @javidx9

    8 ай бұрын

    Thanks Dorian!

  • @donnyp
    @donnyp Жыл бұрын

    Clear and precise, thank you sir

  • @jgurtz
    @jgurtz3 жыл бұрын

    Thanks for the great introduction to some standard containers!

  • @uzkjhgfdsewr
    @uzkjhgfdsewr3 жыл бұрын

    What I'm learning here is less of STL-containers having weird consequences, I'm learning about pointers having weird consequences (so you should use them only if needed and only if encapsulatable).

  • @acho8387
    @acho83873 жыл бұрын

    I'm loving this! Many thanks!

  • @andrewphi4958
    @andrewphi49582 жыл бұрын

    Wow! Your speech pace and tone are just great and reminded me of techmoan so much! ))

  • @H3liosphan
    @H3liosphan3 жыл бұрын

    This is great. Thanks! I 'learned' C++ in the mid 90s, pretty sure std::array, std::vector and std::deque weren't around then! Amazing modern improvements. mostly I used standard C and more lately C#, which appears to have many similarities to this, but I'd imagine is burdened more by MS and .NET added latencies. There's a reason the Unreal Engine was built in C++.

  • @tezza48
    @tezza483 жыл бұрын

    Fantastic video Javid :) I always pick up a few gems i didn't know!

  • @javidx9

    @javidx9

    3 жыл бұрын

    Thanks Tezza!

  • @lercenico8260
    @lercenico82602 жыл бұрын

    congrats on 256k subscribers ✌️

  • @OEFarredondo
    @OEFarredondo3 жыл бұрын

    Bro, thank you. I appreciate your time and effort.

  • @dempa3
    @dempa33 жыл бұрын

    Thank you for another interesting video! I'd be really interested in more videos on proceduraly generated content and especially on how to "save" the users interactions with the proceduraly generated content. And to go even further it would be very interesting to know if one could proceduraly generate agents, besides the user, who interact with each other and the rest of the content independently of the user, as well as with the user.

  • @anonanon3066
    @anonanon30663 жыл бұрын

    Thanks for providing this information for free!

  • @jacopopecchini2267
    @jacopopecchini2267 Жыл бұрын

    THank you! this helped a lot understanding containers. I would also print che container's capacity, because for vectors it is interesting to see how it doubles every time the size hits the capacity limit.

  • @javidx9

    @javidx9

    Жыл бұрын

    Thanks, doubling is just one strategy that empirically turns out to be reasonably efficient. Different implementations may not always double.

  • @Danieldrd
    @Danieldrd3 жыл бұрын

    Fantastic video. Very informative, thank you!

  • @GrandNebSmada
    @GrandNebSmada3 жыл бұрын

    Every time you have the idea to do a video like this, you should do it 1 week earlier, because we literally just went over linked lists in my CS class and this would have been really great to watch ahead of time haha. Great video as always!!

  • @cheaterman49
    @cheaterman493 жыл бұрын

    I'm only 10 mins in and already love the primer on modern C++, hahaha! So many things one doesn't know when they only learned C++98 :-)

  • @Idlecodex
    @Idlecodex3 жыл бұрын

    CppCast?! Great crossover! I’m going to check that in 31’41”!

  • @rohanchavan5778
    @rohanchavan57783 жыл бұрын

    Thank you for the video...hope to see more from you!

  • @gurnoorsingh8557
    @gurnoorsingh85575 ай бұрын

    Man you did really great , understood everything

  • @davidjulitz7446
    @davidjulitz74462 жыл бұрын

    In the "good old days", we implemented those containers by ourselves and often enough ended up in a mess. Good that modern C++ changed this. On the other hand to reinvent those containers might help to learn some bits. However, nice and helpful video.

  • @MrSebaleme
    @MrSebaleme2 жыл бұрын

    Very efficient and video. Thank you so much!!

  • @ZizoAhmed
    @ZizoAhmed2 жыл бұрын

    Finally a video I can complete on this channel . xD

  • @aaaaanh
    @aaaaanh3 жыл бұрын

    Thanks so much for the review session :D

  • @durrcodurr
    @durrcodurr3 ай бұрын

    What std::vector does, can easily be found out by reading its source code. Many implementations by default reallocate the vector for every element added at the end of the vector. The solution for this is to create your own vector scaling policy (for instance, automatic exponential scaling). This is done by using the capacity() and reserve() methods of the vector class. Since many programmers are oblivious to this, improperly written C++ code using the vector class can get really slow. Apparently, modern implementations (like for C++20) now finally use at least quadratic exponentiation when scaling up vectors.

  • @manuelnovella39
    @manuelnovella393 жыл бұрын

    Wow! I loved your video, really. Donald Knuth would be pretty happy, I think. More on data structures, please? Maybe going in depth on the use of sets and maps or covering trees and graphs? That'd be awesome. In my opinion, trees deserve a whole separate video

  • @nathanbanks2354
    @nathanbanks2354 Жыл бұрын

    After switching from Java/Python to C++ for a project, this is incredibly useful. Wish I watched it ages ago! It seems as if C++ is borrowing cool stuff from other languages, but the notation is super weird because it still has to be backwards compatible with C programs. I've never really missed the auto keyword in Java, though I do use Array instead of Array sometimes.

  • @obinator9065
    @obinator9065 Жыл бұрын

    20:14 I’ve found that vectors crush linked lists in every single test at a higher element count, even insertion. If I pick a doubling capacity strategy (I believe GCC does this), I’ll make around 10 allocation and 10 memcpy() calls for the first 1000 items. The LinkedList will make a 1000, as this grows list will grow more inefficient in insertion time while the vector is crushing tests.

  • @silverhoof1027
    @silverhoof10273 жыл бұрын

    love your work

  • @MrAndrewiphone1
    @MrAndrewiphone13 жыл бұрын

    I was expecting to see some sort of c++ "made from scratch" docker or something xD I only knew Java Collections, so it was nice to learn what c++ has to offer

  • @gilleswalther5964
    @gilleswalther59643 жыл бұрын

    I don't know why these video are making me happy :-)

  • @anouarbagent2511
    @anouarbagent25113 жыл бұрын

    this is one the those channels that you automatically leave a like in any of its videos without even thinking.

  • @gopalsv5230
    @gopalsv52309 ай бұрын

    Very fruitful info of roots and well compared between each container very precisely. 👍😍💕💕💕👌

  • @thomasjefferson6225
    @thomasjefferson6225 Жыл бұрын

    coming from python, and starting to learn c++.... this video made so much sense.

  • @iltrovatoremanrico
    @iltrovatoremanrico3 жыл бұрын

    Thank you for this video!

  • @justasydefix6251
    @justasydefix62513 жыл бұрын

    These videos are too precious! we must copy them into a vector.

  • @drewprof
    @drewprof3 жыл бұрын

    Good review!

  • @delqyrus2619
    @delqyrus26193 жыл бұрын

    11:01 As a physicist i would say that a vector is an arrow. The general usage as some point is absolutely confusing and doesn't make much sense. Of course, an arrow can point on some point, but in general it points to the direction of some point.

  • @javidx9

    @javidx9

    3 жыл бұрын

    And you would be correct. Vector is a dreadful name for this data structure.

Келесі