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

preview_player
Показать описание
This tutorial provides clear visual representation of what is happening as a linked list is coded.

STILL NEED MORE HELP?
Connect one-on-one with a Programming Tutor. Click the link below:

:)
Рекомендации по теме
Комментарии
Автор

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

TheSweBoo
Автор

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

bruxeiroJedi
Автор

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-<next=NULL), since t is now pointing to n as well

SilverMiraii
Автор

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

lagosure
Автор

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

JV-jcci
Автор

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.

AttentiveDragon
Автор

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.

RaviKumar-wyvr
Автор

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

ojolivier
Автор

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

NoVideo
Автор

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

rohankar
Автор

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 :)

monome
Автор

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

andruvasiliu
Автор

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

GeoffIanLewis
Автор

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

williammock
Автор

Even after 10 years, this video is still amazing!

nomuraamraa
Автор

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

chayanbarman
Автор

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.



samh
Автор

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

timsabitov
Автор

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

lovernchong
Автор

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

sparksteryt