Introduction to Linked Lists, Arrays vs Linked Lists, Advantages/Disadvantages - C++ Data Structures

Sdílet
Vložit
  • čas přidán 27. 07. 2024
  • A linked list is a data structure used to store and organize data. This tutorial is an introduction to linked lists. You will learn how to use linked lists, the important advantages and disadvantages of linked lists, the differences between linked lists and arrays, and how to implement a linked list in the C++ programming language. I'll also teach you how linked lists work with functions and how you can access elements of the linked list (nodes) and how you can pass the linked list to a function.
    📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
    C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
    Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
    🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
    Experience the power of practical learning, gain career-ready skills, and start building real applications!
    This is a step-by-step course designed to take you from beginner to expert in no time!
    💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
    Use it quickly, because it will be available for a limited time.
    Download Visual Assist here: bit.ly/WT-CB
    I use it to enhance the performance, features, and support for C, C#, and C++ development in Visual Studio.
    Download Ultra Edit here: bit.ly/UE-CB
    It is a powerful, secure text editor designed specifically for programmers.
    ☕ If you've found my content helpful and would like to support me, you now have the option to buy me a coffee or a cookie! It's a small gesture of gratitude that means a lot to me and helps me keep creating free educational videos for you. Use the link to make a contribution: bit.ly/CodeBeauty_BuyMeACoffee
    However, please don't feel obligated to do so. I appreciate every one of you, and I will continue to share valuable content with you regardless of whether you choose to support me in this way. Thank you for being part of the Code Beauty community! ❤️😇
    Contents:
    00:00 - What will you learn in this course?
    00:40 - Introduction to linked lists, What are linked lists?
    03:35 - Differences between linked lists and arrays, advantages/disadvantages
    07:28 - How to implement a linked list in C++
    12:52 - How to link the nodes (How to link the elements of the linked list)
    16:03 - Linked lists and functions
    Other tutorials mentioned in this course:
    Lists (real app example) - • C++ List (Real example...
    Arrays - • DATA STRUCTURES - How ...
    Structures - • C++ Structures for beg...
    Classes, OOP Playlist - bit.ly/3sn0WQt
    Pointer Playlist - bit.ly/2NXCjex
    Tag me on you Instagram story:
    Instagram 📸 - / truecodebeauty
    Twitter 🐦- / truecodebeauty
  • Věda a technologie

Komentáře • 457

  • @CodeBeauty
    @CodeBeauty  Před 2 lety +46

    📚 Learn how to solve problems and build projects with these Free E-Books ⬇️
    C++ Lambdas e-book - free download here: bit.ly/freeCppE-Book
    Entire Object-Pascal step-by-step guide - free download here: bit.ly/FreeObjectPascalEbook
    🚀📈💻🔥 My Practical Programming Course: www.codebeautyacademy.com/
    Experience the power of practical learning, gain career-ready skills, and start building real applications!
    This is a step-by-step course designed to take you from beginner to expert in no time!
    💰 Here is a coupon to save 10% on your first payment (CODEBEAUTY_YT10).
    Use it quickly, because it will be available for a limited time.

    • @IAkar
      @IAkar Před 2 lety +1

      Could you make a Vector Video? By the way i like you soooooo much :)))))))))

  • @HollowGuy0
    @HollowGuy0 Před 2 lety +49

    I struggle with my professor's way of explaining this. You did it in just 24 mins. Thank you.

    • @CodeBeauty
      @CodeBeauty  Před 2 lety +2

      Happy to hear that ☺️🤗🥰

  • @Tylasian
    @Tylasian Před 2 lety +142

    Learned more in 24 mins than my professor in 2 hours. Thank you!

    • @JonathanReyes-nb8ws
      @JonathanReyes-nb8ws Před 10 měsíci

      Same

    • @adamburri1088
      @adamburri1088 Před 9 měsíci +3

      I wholeheartedly agree, I'm taking data structures and algorithms this semester, and what the prof took to explain in a week, 23 mins got me more!

    • @careenwasonga
      @careenwasonga Před 7 měsíci

      @@adamburri1088same lol

  • @user-ss6ko9oj7s
    @user-ss6ko9oj7s Před 7 měsíci +10

    I am a college student who is watching in Korea
    There is no such high quality C++ video in Korea
    Thank you for the good video!!

  • @SalmanKhan-wk3pk
    @SalmanKhan-wk3pk Před 3 lety +70

    You're the only one that finally made this understandable to me. Thank you so much plz continue this series !! I would like to see the series upgrade to the intermediate level. Thank you again, Saldina!

  • @abdel-rahmansayed6384
    @abdel-rahmansayed6384 Před 3 lety +12

    I really appreciate your work, you helped me understands this particular topic which was both easy and confusing at the same time.
    Keep it up💪🏻

  • @anuragvashishtha3841
    @anuragvashishtha3841 Před 3 lety +2

    Clear and Concise explanation!
    Backed with a lot of Well Supported, Real world Examples.
    Learning C++ through your channel is so much of joy!!

  • @Dronebotworkshop
    @Dronebotworkshop Před 3 lety +78

    I recently discovered your channel and I just have to say that you are doing an amazing job with these videos. You have a great teaching style and I love the way you use practical examples to illustrate concepts.
    I use C++ when working with microcontrollers like the Arduino, and while there are a few syntax differences it is very similar, so your videos have been a great resource.
    I know you get many requests for other languages as well, and as a CZcamsr myself I understand that it's impossible to entertain them all. If I were to make a request I would love to see you do a series on Python after you conclude the C++ tutorial series. So you can add that to the list!
    I wish you every success with your CZcams channel.

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +12

      Thank you so much for that comment! I really put a lot of work into these videos, especially to overcome the foreign language obstacle, so I appreciate very much the support that I get.
      I have a lot of TODO videos, and I also have to be honest and say that Pythons is not my strongest language.
      I was planning to focus on C++, C#, and JS mostly because those are the languages that I use the most, but I don't have any fixed plan for the future. Are you interested in those maybe?
      I wish you the best of luck with Arduino programming and a lot of success with your channel as well. 🤞🧡🧡

    • @Dronebotworkshop
      @Dronebotworkshop Před 3 lety +9

      @@CodeBeauty Well I would say that you have definitely overcome the foreign language obstacle, your English is excellent.
      I certainly will be interested in seeing more of your C++ videos and look forward to the JavaScript ones, I have familiarity with both languages but it has been a few years since I used JS, so I'm sure I'll learn something.
      Keep up the great work Saldina, I predict that you'll soon have a CZcams Silver Play Button to hang on your wall!

    • @DaleDix
      @DaleDix Před 3 lety +3

      Mr DroneBot in the house!

    • @yohansenurga4044
      @yohansenurga4044 Před 3 lety +1

      @@CodeBeauty Guess what your English is more understandable than (no offense) other programming CZcamsrs. I really appreciate your effort and we will continue supporting you.

    • @nunorodrigues5628
      @nunorodrigues5628 Před 3 lety +1

      @@CodeBeauty this is the best best crossover of 2021!

  • @Neiltxu
    @Neiltxu Před 2 lety +7

    your videos are insane, you made me feel that c++ wasn´t as difficult as it was being for me at university, thanks a lot and best wishes from Spain.

  • @artisticnights6222
    @artisticnights6222 Před 2 lety +5

    You are a life saver I have taken data structures three times and never understood it especially linked lists and you made it so simple THANK YOU T--T

  • @potatoitis3326
    @potatoitis3326 Před 2 lety +2

    Thank you so much!!!!! This video was so helpful in helping me study for finals as well as understanding my data structures class. You made this concept so much easier to understand than my professor.

  • @reflex9238
    @reflex9238 Před 7 měsíci

    By far the best video I've seen on link lists and the implementation of them in C++. Oh my god so many videos go into understanding what they are, but never teach what an implementation of them look like especially the syntax when being introduced to new syntax like -> which I wasn't aware of, or how you need to link your link list otherwise it's no longer a link list. This is a lifesaver and doesn't start with some syntax that no one has ever seen before and keeps it basic. If you go into anything a bit weird its explained. Thank you so much for the video it was super helpful in understanding what implementation of a link list looks like in C++.

  • @rayanalasow7035
    @rayanalasow7035 Před 11 měsíci +2

    Loveeeeee the explaination. I feel like you do a good job in explaining the things that sometimes are pushed under the rug and that is sometimes the difference between feeling completely stuck vs finally understanding an otherwise simple concept.

  • @Mike-lr2bc
    @Mike-lr2bc Před rokem

    This video made my life so much easier. I've been struggling in my data structures class for 10 plus weeks now, professor was confusing to listen to, tutor was confusing to listen to but this video made everything clear

  • @atrijpaul4009
    @atrijpaul4009 Před 2 lety

    I recently came across your channel and I must say the way you explain is commendable. Thanks for such great explanation of all the minute details of the code

  • @Michael-tf3hj
    @Michael-tf3hj Před 2 lety +1

    By watching this video I have contemplated not only the beauty of code, but also the beauty of programmers. Thanks a lot for that video! Seems to be one of the most beneficial.

  • @painsme2
    @painsme2 Před 3 lety +2

    These are really informative video's. I appreciate you taken the time to do so. Thank You and Cheers!

  • @Awanderer15
    @Awanderer15 Před rokem

    Finally after trying for almost a week and surfing dont know how many channels i found this channel who make me understand how to create a linked list in minutes at once
    I cant thank you enough literallyy tears in eyes .. Thank you you are realky doing a great work each concept is clear avout creating a linked list .
    Thank you so much

  • @milkamilkica1935
    @milkamilkica1935 Před 3 lety +17

    Love how you explain everything so simple and easy!

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +1

      Happy to hear that you learn from videos! 🤞🤗🧡

    • @dvega920
      @dvega920 Před 3 lety

      @@CodeBeauty I second Milka's comment! I've spent a ridiculous amount of time (hours) reading and rereading my text book to understand linked lists and you very eloquently showed me in a matter of minutes. Thank you and keep up the great work! I will be following you for more C++ videos as this has been a trouble language for me to pick up. Best of Luck!

  • @yohansenurga4044
    @yohansenurga4044 Před 3 lety +1

    You are the best. You really explain very well wow. My professor took two classes which mean 150 minutes to teach about the Linked list but still, I didn't get it but now in less than 24 minutes I learned a lot from you. Thank you.

  • @PureASM-ShellCoder
    @PureASM-ShellCoder Před 3 lety +1

    Thank you very much ! You're the best ! 😌 You've gotten me into programming again … !

  • @garcj1499
    @garcj1499 Před 3 lety +4

    I decided to watch the entire video at 1am for fun instead of going to sleep. Linked lists have never been this clear to me until now, thanks to you!

  • @SHIVAMSHUKLA-be7zj
    @SHIVAMSHUKLA-be7zj Před 2 lety +1

    amazing explanation.. i wish i had a teacher like you.. respect... in this era where people are making insta youtube reels , which are absolute trash.. people like you are really motivating us.

  • @zombiehellmonkeygaming1956

    Wow, thank you for the brilliant explanation! You make everything sound so simple. I have only ever used std::list, so to understand how linked lists actually work under the bonnet really helps.

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +1

      I'm happy that you find my explanation helpful and that you understand how LL work inside 🤞🤗🤗

  • @murtazahonarpoor4252
    @murtazahonarpoor4252 Před 2 lety

    You explained the linked list very clear and concise. Thank you!

  • @timetofilmit5441
    @timetofilmit5441 Před 3 lety

    Clear and concise. Thank you for your help!

  • @grandparick3176
    @grandparick3176 Před 3 lety +1

    I really love the way you explain things.

  • @naziabutt8142
    @naziabutt8142 Před rokem

    beautifully explained .you just made it sooooo simple to understand.thank you.....

  • @jiaweiguo3987
    @jiaweiguo3987 Před 3 lety

    Thanks you so much Your videos are very helpful and simple to understand.

  • @Nikhil-vo4qu
    @Nikhil-vo4qu Před rokem +1

    Thank you so much di ! this helped me a lot !!! May the force be with you !

  • @joehibbler7120
    @joehibbler7120 Před 2 lety +2

    My last year until I graduate BS computer Science ... Thank you so much your lessons are great.

  • @learntoearn6612
    @learntoearn6612 Před 2 lety +2

    video posted on 24/Feb/2021, Today 8/Dec/2021 still helpful and will continues being helpful. *Thanks Saldina*

  • @vedkorla300
    @vedkorla300 Před 2 lety +3

    Thank you so much, I didn't have much knowledge about pointers to begin with, yet your explanation was so nice that I didn't need to revisit it at all.

  • @dexterjohnson1842
    @dexterjohnson1842 Před 11 měsíci

    Your videos are very helpful. You explain well. Thanks!

  • @cranixstein6207
    @cranixstein6207 Před rokem +3

    Thank you very very much Saldina, your videos on C++ are so precious and understandable.

  • @2minhacks
    @2minhacks Před 2 lety +1

    Thank You
    This video helped me in understanding concept of the linked lists,
    I have watched many videos but this video makes everything clear.

  • @kaivalyakumar8249
    @kaivalyakumar8249 Před 2 lety +1

    Thnx, you are great in explaining things....

  • @Sisi_San
    @Sisi_San Před 3 měsíci

    You are so amazing! I love your teaching and can't wait to learn more!

  • @bubble_gum_witch
    @bubble_gum_witch Před 2 měsíci +2

    Thank you so much, your way of explaining is so clear and understandable. I really needed this video!!

  • @tsalVlog
    @tsalVlog Před 3 lety +1

    as a long-ago C/C++ dev (c. 1998) and a current Kotlin Java dev, this is relevant to my work and interests!

  • @ramiyousif8024
    @ramiyousif8024 Před 2 lety

    Thank you for all these amazing videos, I really love the way you use to teach, would you show us how we make a doubly linked list please, thank you again.

  • @thelittlemermeigaming9122

    Your channel has been a huge help and now I look for your channel when searching for a topic regarding C++, would you ever make a video regarding destructors as well?

  • @BrainyBlas
    @BrainyBlas Před 6 měsíci

    Amazin job in such a way that, you train viewers from basic to advance without missing any aspect.

  • @AbdulHadi-wl8ek
    @AbdulHadi-wl8ek Před 3 lety

    Hi, I really enjoyed the video and it also clears my concepts about linked lists. I have a request you to make a video on doubly linked lists as well as possible. I'll be very thankful for this. Thanks.

  • @adeniyiladenegan7450
    @adeniyiladenegan7450 Před 2 lety

    CodeBeauty, Thank you so so much for all you do. Please don't stop making your videos. Could you do a video on event streaming such as kafka?
    I find it so easy with your explanations.

  • @Rob-147
    @Rob-147 Před rokem

    thank you for breaking it down like this!

  • @rein29233
    @rein29233 Před rokem +1

    Finally understood after going through many videos. Thank you

  • @chvaishnavi7985
    @chvaishnavi7985 Před 2 lety

    You're a saviour. How nicely you have made me to understand the topic i cant explain thanks
    🥰

  • @klevialushi571
    @klevialushi571 Před 3 lety +2

    Thanks for the video!

  • @islamtarek5040
    @islamtarek5040 Před 2 lety

    Excellent explanation.
    Thanks you for your efforts.

  • @pandax_185
    @pandax_185 Před 3 lety

    Definitely one of the best channels ever seen ❤️

  • @maytezhou2585
    @maytezhou2585 Před 3 lety +1

    Thank you so much for taking your time to explain this concept in a very detailed way.
    You are so inspiring 💪.
    Lots of love from Peru💖
    By the way, please, can you make a video about how to create a Linked list, insert and delete a node, but using pointers to pointers ??
    For example, a function that creates a linked list that uses a pointer to a pointer would look like this: void createList(NODE **head)
    What are the advantages of using pointers to pointers? and when should we use them ??

  • @MegaDoc360
    @MegaDoc360 Před rokem

    Phenomenal explanation, thanks!

  • @Xxnightwalk1
    @Xxnightwalk1 Před 2 lety +1

    Very clear, as always
    Your videos are very helpful :)

  • @joseloeza371
    @joseloeza371 Před 2 lety

    Happy new year bonita... Excelent video... Please more like this with data structures

  • @Bess_Gates
    @Bess_Gates Před rokem +1

    I really appreciate what you do, thank you

  • @wongy4487
    @wongy4487 Před 2 měsíci

    thank you so much !! your explanation is great!

  • @zannatulferdousbristy235
    @zannatulferdousbristy235 Před 2 lety +1

    Yes, I got now easy explanation . Thanks and upload more.

  • @HiImAmazing123
    @HiImAmazing123 Před 2 lety +1

    You are a life saver. Thank you!

  • @mohammedalharbi158
    @mohammedalharbi158 Před 2 lety

    You are a LIFE SAVER thank you from the deep of my heart.

  • @mmuzzammil8394
    @mmuzzammil8394 Před 2 lety +1

    Wow, you explain better than my teacher! Thank you!!

  • @PauloSilva-mi3rk
    @PauloSilva-mi3rk Před 3 lety

    Hi,
    congrats, your videos are just perfect to understand.
    Can you make more videos related to linked lists, covering INSERT, REMOVE, CHANGE or LOOK for items in a list?
    Thanks

  • @UET_TECH
    @UET_TECH Před rokem

    i have seen many videos..but only from ur video i learned it and best explanation..thankuu

  • @salmale3783
    @salmale3783 Před 3 lety +3

    women are very caring and have a very good way of explaining things ♥️♥️I'm proud of you

    • @CodeBeauty
      @CodeBeauty  Před 3 lety +1

      Thank you so much for this genuine comment! ❤❤❤

  • @luism5822
    @luism5822 Před 3 lety

    Thank you for the video it was very helpful. It would be also great if you could make a video about Lambda functions in C++

  • @ChristianRicciChrySalis
    @ChristianRicciChrySalis Před 2 lety +1

    You helped me a lot, thank you 🙏

  • @manhhungnguyenxuan5315

    thank a lot, great video.
    From Vietnamese student with love!

  • @conceptwithayan4737
    @conceptwithayan4737 Před rokem

    amazing concept love your teaching method

  • @cloudyclouds5737
    @cloudyclouds5737 Před 4 měsíci +1

    Thank you so much 💗😊
    It really helped me

  • @mujiahmed5448
    @mujiahmed5448 Před 10 měsíci +1

    you are truly the best

  • @joebosah2727
    @joebosah2727 Před 2 lety +1

    Thanks, you nailed it

  • @roseproctor3177
    @roseproctor3177 Před 2 lety

    this is a fantastic explanation, wow

  • @aryapavale2727
    @aryapavale2727 Před rokem

    Great explanation ....thank you 😊

  • @arghyadas4138
    @arghyadas4138 Před 2 lety

    Awesome Explanation

  • @killatony4093
    @killatony4093 Před 4 měsíci +1

    Thank you Ms.Coding Lady.

  • @hussain6043
    @hussain6043 Před rokem

    Thank you so much Mam !! Your videos are so much helpful👍.

  • @shin5302
    @shin5302 Před rokem

    Thank you for your great explanation!

  • @MartinGG996
    @MartinGG996 Před 3 lety +2

    I was having doubts with this very topic. Nice video!

  • @sherylli4161
    @sherylli4161 Před 2 lety +1

    wow!! I just discovered your channel- i've always struggled to understand linked lists but in this video, everything just clicked. THANK YOU SO MUCH

  • @abugslife2461
    @abugslife2461 Před rokem

    Thank you, this was a very helpful video!! :)

  • @ArslanBajwaOfficial
    @ArslanBajwaOfficial Před rokem +2

    Your teaching style is very good the best teacher ever..❣

  • @eminbaybarstimurstudent3802

    void printList(Node *head)
    {

    if (head->Next != nullptr)
    {
    cout Value Next);
    }
    else {
    cout Value

  • @DeepakVerma-tw3yk
    @DeepakVerma-tw3yk Před 3 lety

    Thanks for this awesome video.
    You are best and your content is very very easy and understandable easily

  • @turddisturb
    @turddisturb Před 2 lety

    Good content and well explained. Thanks!

  • @legityash
    @legityash Před rokem +1

    This video was helpful 💯

  • @mathilda247
    @mathilda247 Před měsícem

    Thank you for fluencer and understandable English ❤

  • @Gks2k
    @Gks2k Před 2 lety

    very use full video ma'am thank you

  • @MushroomGravy
    @MushroomGravy Před 3 lety +2

    I caught the beginning but was distracted through the middle. I caught the question, my answer was "It needs the Head. It requires a basis, a point of reference from which to start".
    I start my degree next week, and even though I have no previous experience, when you said the answer was the same as mine I cannot express the joy I felt.
    Thanks so much for taking the time to make videos like this. It may seem like "revision" to someone familiar, but to someone like me (and your recommendations on learning Java at the start), I don't know it's hard to explain.
    But you're so damn attractive I can't concentrate lol and it's mostly why I was walking around listening half the time. I can never look at Batman the same way again. However, I'm sure I'll manage :)
    In all serious, you're wonderful. You and many others like you ( e.g. freecodecamp) have really opened my eyes to a wonderful new world for me to explore. I'm so excited!
    Please, don't stop. Any of you.

  • @BizBlitzShorts
    @BizBlitzShorts Před 3 měsíci

    I found it really hard to understand the concept of linked lists but you made it seem very easy. Thanks!

  • @NIKHILSINGHRA-zs5fm
    @NIKHILSINGHRA-zs5fm Před rokem

    hanks lot Sir.. You helping us..

  • @ElizabethWoolridgeGrant0

    Thanks! This video really helped.💖💖

  • @ussumaneembalo2643
    @ussumaneembalo2643 Před měsícem

    This video is so well explained, thanks allot

  • @ee99858
    @ee99858 Před 3 lety

    Epic tutorial, thanks!

  • @Lalinxdboom
    @Lalinxdboom Před rokem

    you are the only one who is helping me to be a c++ advanced learner

  • @bideshsengupta9455
    @bideshsengupta9455 Před 3 lety

    Thank you so much for your effort.

  • @sebastianionel5134
    @sebastianionel5134 Před 3 lety +12

    If people don't want to use public variables in a class (not pretty cool to use public variables in classes and not so great to practice) they can check this code right here. I did some OOP things:
    class Nod { // Nod = Node in my language
    int valoare; // valoare = value in my language
    Nod* next;
    public:
    // I did a constructor also to avoid making a very big column of initializations. If I don't pass the next Node, then the default value is a nullptr;
    Nod(int valoare, Nod *next = nullptr) : valoare(valoare), next(next) {}
    // Here are some getters and setters that can access the private variables.
    void setValoare(int valoare) {
    Nod::valoare = valoare;
    }
    void setNext(Nod *next) {
    Nod::next = next;
    }
    int getValoare() const {
    return valoare;
    }
    Nod *getNext() const {
    return next;
    }
    };
    void printList(Nod* n) {
    while(n){
    std::coutgetValoare() getNext(); // This is a pointer so that's why you can do this.
    }
    }
    int main() {
    // linked list example with 4 elements:
    Nod* head = new Nod(1);
    Nod* second = new Nod(2);
    Nod* third = new Nod(3);
    Nod* last = new Nod(4);
    // here I was pretty lazy to implement the pointer in constructor thing (the stuff you need to pass as a parameter to the construct to point to the next node) so I did this:
    head->setNext(second);
    second->setNext(third);
    third->setNext(last);
    printList(head);
    // std::cout

  • @burntt999
    @burntt999 Před 2 lety

    Thank you ma'am. helped a lot.

  • @aiconz-net3207
    @aiconz-net3207 Před rokem

    Thank you so much.

  • @user-kh8zj2ol2l
    @user-kh8zj2ol2l Před 29 dny +1

    This leson is very usefull thanks very muthc

  • @namandacarolinebetty6814

    You are the best teacher