Data Structures Using C++: Implementation - Inserting a Node into a Linked List (Sorted Linked List)

Related Videos:
Inserting a Node into a Linked List (Logical Representation) • Data Structures Using ...
Traversing a Linked List • Data Structures Using ...
Linked List Implementation Part II (List Class) • Data Structures Using ...
Linked List Implementation Part I (Node Class) • Data Structures Using ...
Concepts:
How to implement an insert function in C++ to maintain a sorted linked list.
Insertion into an empty list
Insertion at the head of a list
Insertion beyond the head of a list
Traversal of a linked list to find insert location.
Usage of a current and trail pointer for inserting a node.

Пікірлер: 28

  • @michaelbarron6687
    @michaelbarron66873 жыл бұрын

    8 years since you posted but this video just saved my weekend. Thank you!!

  • @dark.violin
    @dark.violin2 ай бұрын

    11 years later and it is amazing

  • @rayxr
    @rayxr4 жыл бұрын

    I like that you use current and trial variables instead of the vague "temp1, temp2" of other KZreadrs. It made me understand the concept much better

  • @MegaGorgot
    @MegaGorgot8 жыл бұрын

    i fucking love you bro.

  • @Toddmeister1422
    @Toddmeister14229 жыл бұрын

    Very useful vid. At the end of your videos please include a shot of the whole thing so that we can see it in it's entirety. It would make it a lot easier to understand all at once as opposed to jumping around in the vid to see the different parts.

  • @Twysthor
    @Twysthor10 жыл бұрын

    You taught me a lot in this series of videos. I understand linked list more. Very Helpful videos, thank you!

  • @joshuadyer80
    @joshuadyer807 жыл бұрын

    Thank you so much for posting this as well as your video explaining the logic graphically - being able to go over a good explanation over and over is so helpful.

  • @tomand285
    @tomand2858 жыл бұрын

    Thank you sooo much!! You are a life saver. I could not figure out where I was going wrong on my college homework and you saved me after hours of debugging.

  • @ewok100
    @ewok10011 жыл бұрын

    This is the best tutorial explaining inserting nodes into a linked list that i have seen! Showing the logical steps and then the implementation is awesome! it really helped me understand. I first did linked lists using structs in C and i found linked lists in c++ harder to understand (in terms of code reading! easier in terms of amount of code) But these linked list tutorials really helped me to get a good grasp of not only an OOP implementation of linked lists, but classes in general! THANKS!

  • @malcolmwilliams356
    @malcolmwilliams35611 жыл бұрын

    This was GREAT i have viewed tons of programming videos and this really helped unlike others!!

  • @piyushkumar-wg8cv
    @piyushkumar-wg8cv4 жыл бұрын

    string comparison compares length, I dont know how you are doing this without operator overloading

  • @ryanflynn386
    @ryanflynn3868 жыл бұрын

    This is great, thank you! I was able to use this to do an insertion for doubly linked lists.

  • @huhututu
    @huhututu10 жыл бұрын

    thank you..this video saved my life

  • @GilbertStar17
    @GilbertStar1711 жыл бұрын

    thanks a lot ! for your info, the command if ( curr->name >= newNode->name) in line 63 didn't work for me, so i used strcmp instead.. best regards, Gilbert

  • @steviegblade
    @steviegblade11 жыл бұрын

    Thank you very much. Was very useful. Thanks once again.

  • @cameronmx9
    @cameronmx911 жыл бұрын

    Thank you for this!

  • @prachisharma8267
    @prachisharma82676 жыл бұрын

    A very big thanks to you :)

  • @rainbow9832
    @rainbow98323 жыл бұрын

    Thank you king 😎

  • @anthonypark9158
    @anthonypark91586 жыл бұрын

    Very useful.. it helped me a lot Thank you :)

  • @Stefan-ef1vv
    @Stefan-ef1vv7 жыл бұрын

    Thank You good sir, I manage to type what you typed in this video just by watching your conceptual drawing one :)

  • @aditya234567

    @aditya234567

    7 жыл бұрын

    good job!

  • @laukuansin
    @laukuansin4 жыл бұрын

    great video

  • @fahimshuvo8232
    @fahimshuvo82328 жыл бұрын

    thank u sir :)

  • @darkyassin
    @darkyassin11 жыл бұрын

    In Case 3, how does it change the head again? you aren't setting the head any more only the local variables newNode->next and trail->next. How does it know that it has to change the head as well?

  • @sambond3210
    @sambond32109 жыл бұрын

    Great Tutorial ! Going through all of them-->Data Structures. I understand a lot from your video. How can i modify this program so that user can input phone numbers(format xxx-xxx-xxxx) and ages with no duplicated ID . And also add method swap(int id 1, int id2) to swap the location of id1 and id2 in the list. Please help ! Thankx.

  • @TheThird555
    @TheThird5557 жыл бұрын

    What about delete? I was always taught, that if you create variable or array or... with dynamic allocation, you need to create delete function so you won't have a leak in a memory? You don't need them with lists?

  • @TheThird555

    @TheThird555

    7 жыл бұрын

    Never mind. You mentioning this issue in the next videos. Thank you for the great videos on the linked lists.

  • @22mahmoud
    @22mahmoud7 жыл бұрын

    How to insert in the last node ?