How to Create a Linked List C++ Introduction to Linked Lists

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024

Комментарии • 852

  • @TheSweBoo
    @TheSweBoo 7 лет назад +872

    You explain in twelve minute a concept that took my teacher more than an hour and still couldn't get clear. Thank you, sir!

    • @animeempire4878
      @animeempire4878 7 лет назад +53

      My teacher didn't even explain because he didn't knew .. LOL :D
      Teachers and schools are totally useless.

    • @syedjamal7191
      @syedjamal7191 6 лет назад +6

      completely agree, my teacher in same condition but still I got mid term tomorrow and its the part of paper :-(

    • @hiddensparkle2278
      @hiddensparkle2278 5 лет назад

      i am also bro

    • @thomasjess5029
      @thomasjess5029 5 лет назад +3

      @@animeempire4878 I wouldn't say completely useless. My C++ teacher had these RUclips videos in the course content folders for us to watch, and he was really good at teaching us the basics.

    • @mattm7798
      @mattm7798 5 лет назад +3

      I think because it's flies in the face of alot of programming language ideas. Pointers themselves take time to get in your head right then you have this data structure, which when drawn out, seems really easy to understand but the syntax is confusing as all heck.

  • @bruxeiroJedi
    @bruxeiroJedi 3 года назад +80

    9 years later and you keep saving our lives in studying Linked Lists. Thank you so much! Greetings from Brazil.

    • @saurabhsaxena1992
      @saurabhsaxena1992 3 года назад

      Ohh i see. I have seen European guys have now a good understanding for specially we indians. My cousin lives in Canada. He is having good friendship with them

  • @lagosure9640
    @lagosure9640 6 лет назад +169

    I literally learned in 14 min what my professor spent 2 weeks explaining. Thank you !

    • @jmoney1941
      @jmoney1941 4 года назад

      Are you still studying C++?

    • @abdullahwaqar3024
      @abdullahwaqar3024 3 года назад

      @@jmoney1941 are you still studying c++?

    • @jmoney1941
      @jmoney1941 3 года назад +1

      @@abdullahwaqar3024 I am.

    • @abdullahwaqar3024
      @abdullahwaqar3024 3 года назад +1

      ​@@jmoney1941ok nice keep learning!

    • @ghassanalkaraan
      @ghassanalkaraan 3 года назад +4

      I put speed to 1.5× watched it. It's like 9 minutes to learn a 2 weeks chapter

  • @SilverMiraii
    @SilverMiraii 7 лет назад +392

    I made this for myself so I can save it in my "lessons" folder in case I need to recap, I explain to myself in stupidly simple terms what each line does, so I thought maybe it will help someone else as well, here it is:
    struct node{
    int data;
    node *next;
    };
    // these are all pointers, meaning they will hold an address
    node*n; // Will be used to create new nodes (n=new node;)
    node*t; // Will be used to link nodes (t->next=n)
    node*h; // Will hold the head of the node, i.e. the first node, used as a reference to access other nodes.
    // creating the first node
    n=new node; // n is a pointer and now holds the address of a newly created node
    n->data=1; // accessing n's data member and setting it equal to 1
    t=n; // t is now pointing to the newly created node, will be used to link nodes
    h=n; // h is now pointing to the newly created node and will remain so as a reference
    //creating the second node
    n=new node; // creating the second node
    n->data=2; // the new node's member "data" is now equal 2
    t->next=n; // t is pointing to the previous node, and we'll set it's (previous node's) "next" member which is a pointer of type "node" to point to the newly created node
    // just like the data type "int" or "double", now our node is a data type
    t=t->next; // t will now point to whatever t's member "next" is pointing to, which is the new node (same thing as t=n, t points to n)
    // thus advancing t (to point to the newly created node)
    // one more node to recap
    n=new node; // creating a new node
    n->data=3; // setting it's member int data = 3
    t->next=n; // linking the nodes
    t=t->next; // advancing t
    n->next=NULL; // the new node's next pointer now points to nothing, and we know it's the end of the linked list (same thing as t-

    • @SilverMiraii
      @SilverMiraii 7 лет назад +26

      I also highly recommend having such a folder for whatever you might be learning, math, programming, anything.
      Whenever you learn something new, you structure that new concept in your mind in a certain way, by writing it down as you structured it in your mind, you can easily recap it in the future.

    • @tommulligan1491
      @tommulligan1491 5 лет назад +2

      That's great and thanks for the advice man

    • @kartikdghangare
      @kartikdghangare 5 лет назад +2

      Thank u for making life easy!

    • @thomasjess5029
      @thomasjess5029 5 лет назад +1

      @@SilverMiraii I was thinking of making a private folder of videos like this, so I won't forget entirely.

    • @stefan770
      @stefan770 5 лет назад +4

      God bless you

  • @JV-jc7ci
    @JV-jc7ci 20 дней назад +1

    The most fundamentally precise visual anyone has ever implemented across any platform. THANK YOU!

  • @RaviKumar-wy9vr
    @RaviKumar-wy9vr 2 года назад +2

    every person who has studied this topic faces almost a similar conceptual problem which has been very nicely eradicated in this video.
    this is the best video for understanding the concept of linked list.

  • @AttentiveDragon
    @AttentiveDragon 3 года назад +29

    This 12 minute video explained what was going on with linked lists better than the entire chapter of my textbook. This helped me out so much, and made my programming assignment finally make sense to me.

  • @NoVideo2024
    @NoVideo2024 7 лет назад +123

    Thnx Mate. I spent 6 hrs understanding it but I couldn't.
    After watching your video I understood it properly. Thnx mate.
    from India

  • @ojolivier2172
    @ojolivier2172 8 лет назад +26

    I have spent the last 4 days prepping for a C++ Data Structures Exam, trying to wrap my head around linked lists and understanding the simplicity thereof... You sir have now been dubbed my Linked Lists guy...
    Great video, very simple and very informative. Just a note, if I may, maybe mention in the start that you need a base knowledge of pointers. I find many ppl don't understand Linked Lists until they fully understand pointers.
    All-in-All, a great video.
    Many Thanks OJ

    • @nusratakhiislam2523
      @nusratakhiislam2523 4 года назад

      i agree with you on the part of pointers. If people dont understand the concept of pointers (what the pointers stores, how they point, what they point) understanding linked list topic becomes harder and it may happen that in the near future people forget how they work.

  • @rohankar9319
    @rohankar9319 6 лет назад +4

    Your twelve mins explanation helped me with my 12 hours of struggle

  • @monome3038
    @monome3038 7 лет назад +9

    You clearly understand data structures that's why you explain the details about pointers, teachers don't do that and blame students for asking questions! Thank you so much, I wish you all the best :)

  • @andruvasiliu7036
    @andruvasiliu7036 7 лет назад +14

    I just love you man. 12 minutes explained everything i was trying to understand.

  • @williammock9067
    @williammock9067 4 года назад +2

    You just cleared up two weeks of lectures that went right over my head.

  • @GeoffIanLewis
    @GeoffIanLewis 10 лет назад +31

    I really appreciate the clear explanation. If only my professors were as good!

  • @nomuraamraa8588
    @nomuraamraa8588 Год назад

    Even after 10 years, this video is still amazing!

  • @alannair44
    @alannair44 9 лет назад

    Thnx man. I had just startd linked lists and was deeply confused. My teacher is absolutely inept at teaching. This tutorial helps a lot. Thanx!

  • @blalmal10a
    @blalmal10a 8 лет назад

    dude, thank you very much.. i'm searching for linked list tutorial over a year.. and i've skipped this video every time.. but you're the only one who explains it with the exact working on how they linked each other and how they changed their linkage... i've heard the theory and now i think i can write my own program... thanks again

  • @lilyoverbagh3388
    @lilyoverbagh3388 8 лет назад +1

    EXTREMELY helpful. I got left behind quickly in lecture this week. I couldn't be more thankful.

  • @lovernchong7756
    @lovernchong7756 11 месяцев назад

    you are a freaking life saver , u taught what my teacher couldnt teach in 12 min, u the goat fr :) i love u so much

  • @siddhantsolanki4890
    @siddhantsolanki4890 7 лет назад +2

    Thank you. This is the first video where I understood everything about linked lists in a go. Wonderful explanation!

  • @chayanbarman337
    @chayanbarman337 2 года назад

    Trust Me This is the best linked list explaination video i have ever seen on youtube

  • @timsabitov7319
    @timsabitov7319 6 лет назад

    Spend 2 weeks with assignment trying to understand what's happening here. All I need was youtube. Thank you.

  • @harshalmali856
    @harshalmali856 Год назад

    bro you are the only one who i am looking for literally whole semester and i got u just before exam
    very nice video
    thankyou so much u teached from zero to hero

  • @user-ze5iz1vb5o
    @user-ze5iz1vb5o Год назад

    One of the best videos to understand linked lists in under 12 minutes.

  • @arsh2935
    @arsh2935 4 года назад

    way good man !
    did not get in my whole 1 hour class of my college but got in 10 mins because of you .
    love from India !!!

  • @samh8308
    @samh8308 11 лет назад

    After 7 days and more than 20 linked list tutorials, I was just about to check myself into the nuthouse. Not bragging, but I'm of reasonable intelligence--top 30 undergrad , 1300 SAT, 1270 GRE, PhD candidate, scientific publications in statistics and programming (just no C/C++ experience). And yet, I couldn't connect the simple concept with the simple code, until now!*
    *One minor point for those using C..."new node" in C++ is the same as "malloc(sizeof(struct node))" in C.
    Thanks!!!!!

  • @zariahuggins3476
    @zariahuggins3476 6 лет назад

    I know everyone is saying it, but I just have to add to the praise. Thank you so much! My teacher spent 3 hours trying to explain this concept to me. And you helped me understand it in under 15 minutes!

  • @PaulProgramming
    @PaulProgramming  11 лет назад +25

    I actually have a 7 video playlist on my channel PaulProgramming called "Creating a Linked List Project in C++" where I do an entire linked list project on the computer screen. I write the program in the first 6 videos, then compile and test it in the 7th. You should check it out.

  • @juanpestana1582
    @juanpestana1582 4 года назад

    I have searched for a good explanation for
    over a week, thanks

  • @parkernoor3268
    @parkernoor3268 4 месяца назад

    Bro I understood the concept in 12 mins in this video
    I watched some other videos about this topic but none of them could explain as good as you

  • @oozyluce
    @oozyluce 11 лет назад +1

    I wish my university teachers were as clear and concise as you are. Thanks so much for your tutorial!

  • @ADyMaza
    @ADyMaza 3 года назад

    got back to this guy.. his teaching can make understand newbie and advanced student as well.. Thanks a lot

  • @sparksteryt1639
    @sparksteryt1639 3 года назад +1

    This channel literally deserves millions of subscribers. I am supporting this channel. Are you?
    (Lots of love from India)

  • @Cada0x1
    @Cada0x1 7 лет назад +1

    Awesome. I'm not a native English speaker. But your tutorial is much more understandable than native vids I watched before.
    Thank you so much.

  • @jangueco4071
    @jangueco4071 6 лет назад

    Thank you so much for making an hour worth of a topic into 12 mins

  • @dennnzz
    @dennnzz 11 лет назад +2

    This tutorial was beyond perfect for understanding linked lists. Thanks so much!

  • @adityagitte
    @adityagitte 2 года назад

    the side by side visualization of memory structure really made the whole concept very clear, thanks a lot, this video finally helped me in understanding how to create a linked list. Thank you once again!

  • @kaniii3908
    @kaniii3908 9 лет назад

    I could never understand how it works before watching your video, but you explained it so clearly.Thank you so much!

  • @pongthanglaishram9413
    @pongthanglaishram9413 3 года назад

    I was learning whole day for this but couldn't understand. Now I find this . Thanks for making me understand. I subscribe now.

  • @douglasclark8234
    @douglasclark8234 6 лет назад

    This video has made linked list so basic in understanding, my teacher has butchered C++ experience for me. Thx you for the video

  • @BMBlasterMan
    @BMBlasterMan 8 лет назад

    Thanks dude, I'm in a computer class and I've never used C++ before. Your video helped me get through it.

  • @007sourabhgoyal
    @007sourabhgoyal 11 лет назад

    Hunting down the internet for days finally got it in just minutes Thanks a lot sir...

  • @crashmoonable
    @crashmoonable 6 лет назад

    Man the way you explain it is amazing. I understand it in just 12 minutes ... THANK YOU

  • @dedepie
    @dedepie 11 лет назад

    The way you drew out the linked list connections made me understand how to use those syntax and how they work,thank you.

  • @toplistmania162
    @toplistmania162 3 года назад

    woah!!
    It took one hour for my teacher to teach that concept and i did not understand a word and you explained in 12 minutes!

  • @AquariusLoveCancer
    @AquariusLoveCancer 11 лет назад

    I understood the linked list concept while ago, however since last two days I was trying to implement it in C++ without any success...After watching this video, I would definitely say that now I can implement it by myself without just coping, pasting and mugging up the code...Thanks a lot...

  • @deveshi7
    @deveshi7 2 года назад

    Thank you for clearing all my doubts with the step-by-step explanation of all the statements in the code.

  • @tungnguyenconghoang5522
    @tungnguyenconghoang5522 5 лет назад +1

    wow, thank you so much Paul. The way you explain the linked list was very understandable and easy to comprehend, which probably saved me hours watching other's videos. Much better than my university professor explanation.

  • @abenezerassefa6066
    @abenezerassefa6066 2 года назад +1

    you're the one that helped me to understand this lesson no cap

  • @bahaatamer1245
    @bahaatamer1245 6 лет назад +1

    since I am new to concepts in C and C++, apart from the keyword "new" being used frequently in C++ (which I forgot how it works in C), majority of this stuff seems easier a bit now, thanks Paul! :)

  • @SirGaff
    @SirGaff 6 лет назад

    I'm still a little confused, but this video helped a metric ton. I really do appreciate it.

  • @mihaelaangelova4616
    @mihaelaangelova4616 3 года назад

    I have a homework to do and this helped me a lot. Thanks!
    It's 02:03am but now's the timeee

  • @saniyamansuri9607
    @saniyamansuri9607 3 года назад

    Awesome explanation. I thought to stop learning data structures becouz I was finding linked list too difficult to learn. But here comes the saviour 😌 . Thank you so much 😀

  • @dreamChaser12
    @dreamChaser12 Год назад +1

    Feeling really grateful to RUclips and you sir❣️. I was trying to clear concept from more than a week 🥲 but wasn't able to learn like how the memory is assigning but you made it all very clear ☺️. Thanks sir a lot because of this one concept i am able to believe that i can do linked list well now. Felling blessed or maybe even i can't even able express my feelings now thanks a lot sir Much respect 🙏.

  • @HytexX
    @HytexX 4 года назад +3

    Thank you so much, sir! This really helped me have a clear idea of how linked lists work.

  • @ryanwithab6239
    @ryanwithab6239 4 года назад

    This should be how this is taught. This explains the code perfectly. Thank you.

  • @deveshmore3106
    @deveshmore3106 5 лет назад

    Sir what a great way of explanation.... I was stuck on this topic a long back .... None of my clg faculty was able to explain Mee like this

  • @redeem5
    @redeem5 7 лет назад +1

    You really helped me finally understand this concept. It's not too difficult, but it sure can be confusing. Reiterating this a few times in the video really helped nail the concept down for me.

  • @fcortesjp
    @fcortesjp 10 лет назад

    awesome.. I read about linked lists in my text book, checked the code samples but I couldn't make any sense out of it (well, some of it).. until now.. thank you so much for this explanation!

  • @aadithyaraj2546
    @aadithyaraj2546 6 лет назад

    Its easy to understand than what my teacher teaches me. Thank you very much!!!!

  • @lei2443
    @lei2443 7 лет назад

    You are awesome, my prof explained it in a lecture for 90 min but I still had no idea. With your video I have finally understood.
    Thanks bro.

  • @parsaai2362
    @parsaai2362 3 года назад

    Thank you. You delivered the best explanation about linked lists ever!

  • @KyleIVO
    @KyleIVO 4 года назад

    Finally I could find the explanation which provided me with clear visual representation of link list. Thank you for sharing your knowledge!

  • @mianasif421
    @mianasif421 7 лет назад

    What a simplest way to deliver the lecture. Thanks Paul Programming

  • @wowiplayguitar
    @wowiplayguitar 4 года назад

    Thanks for this. I was having trouble visualizing what was happening and couldn't catch on. This was perfect.

  • @Khushi41290
    @Khushi41290 8 лет назад +6

    It's very helpful for initiating the data structure learning through C++...
    Good Job! :)

  • @jadenyuki2580
    @jadenyuki2580 11 лет назад

    thank you you helped me understand link lists and pointers for a while I was having trouble understanding the concept, loved the video

  • @markaskfjh1806
    @markaskfjh1806 9 лет назад +1

    Thank you Paul! It's too late for me now my test is tomorrow but it might help other people if you did a video like this for doubly linked list and circular queues if you haven't already

  • @MilesWingsOficial
    @MilesWingsOficial 5 лет назад

    Thank you very much. You taught me so much in these 12 minutes my teacher couldn't teach me in 8 hours.

  • @MsDanielxds
    @MsDanielxds 7 лет назад

    Thanks very much man, i'm from Brazil and i'm searching for weeks a good video about Linked List C++. Amazing explanation.

  • @minisacharias3772
    @minisacharias3772 5 лет назад +2

    Wow.. You made it seem simple.. Luv from India
    2019 anyone??

  • @dictatorrich3412
    @dictatorrich3412 9 лет назад

    This video explained linked lists to me better than any other article or video I have came across. Thank you so much for this. I will definitely subscribe.

  • @byakuyakurenai1345
    @byakuyakurenai1345 4 года назад

    Thank you very much, it was hard to understand what my teacher said but after watch your video, I know how it work (sorry for my bad english).

  • @okhan5085
    @okhan5085 7 лет назад

    Brilliant man, you just explained a big concept that usually takes the professionals to explain in an hour... To the point

  • @vasushashi562
    @vasushashi562 2 года назад

    you helped me with something that my teacher couldnt do,thank you

  • @alijafari9576
    @alijafari9576 10 лет назад +2

    Paul I think we only need two pointers! One Head and one Current.. Whenever we generate a new node we can directly connect it to current->next and then current=current->next. That way we don't need the temp pointer!

  • @fabscs-wy3hp
    @fabscs-wy3hp 7 лет назад

    This linked list was really complicated for me, but you have made it easy. Thanks !!

  • @AkashSingh-tw3uv
    @AkashSingh-tw3uv 9 лет назад

    best!! i m just tring to understand linked list since half year ..FINALLY :) understand it correctly ...THANK u very very much..

  • @paramtrivedi1627
    @paramtrivedi1627 11 лет назад

    The video is awesome.
    The simplicity of your teaching is unbelievable
    I would like if you could make a project in which the concept.
    Thank you very much
    This video has cleared most of my doubts in linked list

  • @LordNorthern
    @LordNorthern 11 лет назад

    Link lists was kind of a pain for me, for some reason. But this tutorial just nailed it. Thanks, you're awesome!

  • @rting1810
    @rting1810 2 года назад

    OMG!!!Your explanation is so clear!!!
    Exactly solved my doubt!!

  • @PaulProgramming
    @PaulProgramming  11 лет назад +8

    You're welcome. I do make math tutorials on my other RUclips channel learnmathtutorials
    I thought I'd give some computer science / programming tutorials a whirl on this channel to see what people thought. I enjoy tutoring and programming so I will definitly be making some more programming tutorials in the future. :)

  • @shadowmere992
    @shadowmere992 4 года назад

    Absolutely the best explanation on the Internet!

  • @ruslan2667
    @ruslan2667 6 лет назад

    Finally got the syntax of C++ pointers. Thanks !

  • @AHMED-nd7zt
    @AHMED-nd7zt Год назад

    this is the best explan ever i spend two days on and i dont get it untill i watch that

  • @Hitherehelen
    @Hitherehelen 11 лет назад

    Hey Paul, I just wanted to say that I thought this video was really helpful. I get the idea of how the node points to the next node now! Thanks!

  • @PaulProgramming
    @PaulProgramming  11 лет назад

    The h pointer references the beginning of the list and each node references the next node in the list. So if we can access the first part of the list via the h pointer, then we can access every node in the list. That way if we need to modify the list in some way, we always can start at the beginning of the list by accessing the h pointer and traverse to the node or nodes that we need to modify.

  • @MusicWeaponsFood
    @MusicWeaponsFood 11 лет назад

    Great video... thank you so much. I have seen other people try to illustrate this, but nothing really helped me out as much as your video.

  • @anushthakumari2393
    @anushthakumari2393 3 года назад

    Explaining was really very nice as many teachers misses some basic concepts visualization

  • @AngelJCProductions
    @AngelJCProductions 8 лет назад

    Dude this was great. I was struggling in class trying to understand this concept.

  • @Marzex1x
    @Marzex1x 7 месяцев назад

    the definition of perfect explanation

  • @Hilary94
    @Hilary94 9 лет назад

    Wish you were my comp sci professor! They make it so much more complicated than it is. Thank you for this video!

  • @guitarmeetsscience
    @guitarmeetsscience 10 лет назад

    THANK YOU!!! I've been trying to wrap my head around the idea of linked lists and your video just made it child's-play. Thumbs-up vote and subscribed.

  • @faysalarab
    @faysalarab 5 лет назад

    thank you, you make more sense then a lot of professors.

  • @viva180
    @viva180 9 лет назад

    Thanks, you helped me a lot! It was one of my horrible topic which nobody could explain me so well as you did. Thanks one more time.

  • @redeem5
    @redeem5 7 лет назад +1

    Thank you very much for this video! It's the best video I've seen that covered Linked Lists which included information on both the concept and the actual coding of a Linked List.
    Linked Lists now make sense to me!

  • @MrCaptianCrunch
    @MrCaptianCrunch 11 лет назад

    you just cleared up what my professor was trying to teach us for a week... in 12 minutes

  • @fire619
    @fire619 8 лет назад

    You explained this better than my professor did for 2 lectures

  • @mattm7798
    @mattm7798 5 лет назад +1

    Thank you so much for doing this. This variable pointers following each node is hard to explain and understand but you did a great job. I really wish arrays in C++ were such as in PHP where they were dynamic and you and have key value pairs and values that can be different data types..

  • @chandupilli6537
    @chandupilli6537 6 лет назад

    very good explanation bro. I can't understand this concept when in class your video helped me so much