I just want to mention that I really appreciate you repeating the important concept over and over again. I don't know about the others, but I really have hard time grasping the memory structure concept inside a computer since I haven't seen one. The only way I get it is when I look and listen the subject repetitiously.
This is beautiful. Thank you for taking your time and effort in explaining how to implement doubly linked lists as well as their actions on the different memory locations. You possess great pronunciation, clarity, knowledge, and appropriate talking speed. Thank you!
wow sir finally i understand why we are using dynamic memory allocation instead of normal allocation i know you cant read any of our comments but still i want to say that u will always be the best teacher not only for me but for most of the online community who are still watching and learning from your videos
There is an easier way to print a list in reverse. We can always store the address of the last Node in the variable Node* tail. Tail will change depending on which Node is at the last position each time we add a New node in the list. We can start at the Tails and using the previous address we can print the list in reverse order, This way we won't have to iterate the entire list before printing it in reverse. I also want to say this is a great video series. The clarity I got on this topic just after watching it once is insane.
He isn't dead. His name is Animesh Nayan . His friend Harsha Suryanarayana is the co-founder to this channel and he is no more. He died in a car accident 15th June 2014. Animesh Nayan is a Software Engineer at Google. "Harsha was the best coder India has ever produced. He was working in a start-up (that he co-founded with Animesh Nayan) MyCodeSchool. He was alumni of Indian Institute of Information Technology, Allahabad. We lost him in a hit and run accident on the night of 15th June 2014." [Source: fossiiita.github.io/humblefoolcup/humblefool/humblefool.html]
sir always u say thanks for watching ..today I m saying thanks for making ......I can't tell u how relieve I m feeling after watching this ..... cz tomorrow is my exam ... 😍😍😍
This is brilliant! Thanks! :) You don't talk about deallocating the nodes after we're done with the list. Shouldn't that be done explicitly since we allocated them in the heap?
Hey man! he is not joking, it really breaks my heart, such a nice person died in a hit and run case. Check out this link. He was one of the best programmers from India. RIP yourstory.com/2014/06/techie-tuesdays-humblefool/
We may or may not keep a tail pointer. Its good to keep a tail pointer, depends upon the use case. When we implement queue using doubly linked list, we keep a tail pointer. But in general, if we would have two links - forward and backward, that's what we would call a doubly linked list.
is this a good approach , i just included a constructor which set next and prev to NULL , so that we dont need to worry about setting up next and prev while inserting a new node ? struct node { node *next; node *prev; int data; node() { next=NULL; prev=NULL; } } *start=NULL,*temp,*end=NULL; void insert_beg(int x) { temp = new node; if(temp==NULL) exit(0); temp->data =x ; temp->next=start; if(start!=NULL) start->prev = temp; start=temp; if(end==NULL) end=start; //initially } is this a good approach ? since now we need not worry about next and prev being NULL , since they would by default be pointing to NULL ... ?
thanks alot. This is very helpful. Please suggest how should i proceed for preparing competitive programming after going through all the data structure series and others available on mycodeschool
Very awesome class. But please reduce the time on the difference among the memory sections since it already introduced several times in previous lessons.
that was really amazing, . BUT I AM QUITE WEAK AT THE BASICS, IS THERE ANY VIDEO OF YOURS WHICH WILL HELP ME CLEARING ALL MY BASICS FOR DATA STRUCTURES.
Thanks you for this wonderful video, how do we modify the code to use it us generic list, i try to use void pointer but i got an error on type casting it bc the data types can different in the same list? Thanks again!!!
Also what do you mean by : head -> prev = newNode; newNode -> next = head; head = newNode; should we not write : head = newNode; newNode -> prev = head;
If you insert newNode at head, newNode->prev will always point to NULL because it's now first element in the list (a new head). The old head is becoming the second element of the list, that's why newNode->next must points to it and head->prev points back to newNode. In your example head will be equal to newNode, newNode->prev will point back to newNode itself and newNode->next is already NULL. This way every time you're inserting node at head you're really throwing away the old head node so the list will always have one element - the last one you have inserted.
Hi, you said that the newNode in GetNewNode is local to GetNewNode but previously you mentioned that the output or the node we get from the malloc function or new Node is global and so the newNode variable were we store the result of malloc should also be global. I am confused and the statement seems contradictory to me. Could you please help me with my confusion? Thanks.
hello thank you foe the video its awesome! i have a question and its killing me, at 8:32 you're inserting InsertAtHead(2) and InsertAtHead(4) but in your drawing you have '2' in address 400 and '2' in address in 600 did you mean to put 4 ?? or are we replicating the Head with the val 2?
Hi bro, When you implement the function "InsertAtHead(int x)", why don't we use the following implementation //********* head -> prev = newNode -> next; newNode -> next = head -> prev; head = newNode; //********* I know that is incorrect, but can you help to clarify my misunderstanding. Thanks and Regards,
in the 8.52 mins of the video we see how to add a new node to the non empty list. but we write 1.head->prev=newnode; 2.newnode->next=head; 3.head=newnode; so my question is can we write newnode->next=NULL; instead of the 2nd statement?
tail is pointer to last node , but we have only pointer to head node so we need to use a loop to go to last node assign pointer to it as tail and while(tail!=null){ print(tail.data); tail=tail->prev; }
8 years passed by and this channel is still helping thousands!!
exactly, even in 2023.
Yes
2024 also
10 years passed by and this channel is still helping thousands!!
I just want to mention that I really appreciate you repeating the important concept over and over again.
I don't know about the others, but I really have hard time grasping the memory structure concept inside a computer since I haven't seen one. The only way I get it is when I look and listen the subject repetitiously.
This is beautiful. Thank you for taking your time and effort in explaining how to implement doubly linked lists as well as their actions on the different memory locations. You possess great pronunciation, clarity, knowledge, and appropriate talking speed. Thank you!
wow sir
finally i understand why we are using dynamic memory allocation instead of normal allocation
i know you cant read any of our comments but still i want to say that u will always be the best teacher not only for me but for most of the online community who are still watching and learning from your videos
It's the best "data structures" tutorial list I've seen in the planet !
lets watch the complete ads without skipping and appreciate this man.
@ how ?
He died in a hit and run. Someone hit him with his/her car and ran and drove off.
really..?
@@lasyagajavelli594 I want to know the truth....
@@standardgu3773 I don't knw either...wherever he is he has to be happy
Sir, I can't even express how helpful your tutorials are to me. Thank you so much for making them!!
Your way of communicating an idea is near perfect (unlike most other coding youtube channels). Keep up the good work.
@@mahedihassanshawon4821 are you serious????/
I don't know why my professor can't not explain this easy as you do! I really hate pointer until I found your great video. You got new subscriber!
I cleared my technical interview after watching these video. Thanks for uploading these clear and precisely explained videos.
Yaar bhai tum saviour ho,I can not thank you enough .Seriously.
Watching this video lectures should be made a part of the College curriculum.These videos helped me a lot during preparations for Exams.
this is the frst tutorial in which i see things explained via code, graphical representation and memory allocation process
There is an easier way to print a list in reverse. We can always store the address of the last Node in the variable Node* tail. Tail will change depending on which Node is at the last position each time we add a New node in the list. We can start at the Tails and using the previous address we can print the list in reverse order, This way we won't have to iterate the entire list before printing it in reverse. I also want to say this is a great video series. The clarity I got on this topic just after watching it once is insane.
Thank you so much humblefool, you make the world a better place.
10 years passed but this channel is helping students now also .
10 years passed by and these explaination of concepts are Just like a WoW...
this is the best DS video i have ever seen
RIP man, even though you are no more your videos are still helping us all.
He isn't dead. His name is Animesh Nayan
. His friend Harsha Suryanarayana is the co-founder to this channel and he is no more. He died in a car accident 15th June 2014. Animesh Nayan
is a Software Engineer at Google.
"Harsha was the best coder India has ever produced. He was working in a start-up (that he co-founded with Animesh Nayan) MyCodeSchool. He was alumni of Indian Institute of Information Technology, Allahabad. We lost him in a hit and run accident on the night of 15th June 2014."
[Source: fossiiita.github.io/humblefoolcup/humblefool/humblefool.html]
Thank you for every codeline of yours.
This is the very definition of a "clear code"
Thank you so much!
Impeccable explanation!!! Cleared all the doubts what I had. I have no words to say thanks..
u said u were gonna talk about circularly linked list . This is really an amazing playlist I wish this was more comprehensive. Thanksss :)))
You have done a great Job ! You really made things easier to understand.. Lectures like this are very hard to find on internet hats off :)
@3:13 BLOWS MY MIND! Impressive! Thank you.
the best data structures playlist ever!
Such a great teacher! Please come back
many years but still watching thanks
you guy just amazing ..even my teacher can't explain like this
Thank you, finally getting to understand how DLL work
Very awesome! I don't speak english very well but i have understood all... this is a very nice tutorial.
BEST Tutorials of DS...excellent explanation...supreme clarity and knowledge
sir always u say thanks for watching ..today I m saying thanks for making ......I can't tell u how relieve I m feeling after watching this ..... cz tomorrow is my exam ...
😍😍😍
Sir is no more
sir where is the video for circular linked list?????
and thanks for ur videos helping me a lot
Videos are extremely clear and useful. Thanks a lot.
All the tutorials are the best and really helpful :D
MAY ALLAH GUIDE YOU
He is no more. He died on 15th June 2014.
Fuck off dude, if you want to believe in 7th century bullshit, don't use technology and watch these videos.
Thank you for taking out time and making these videos. I really like the way you explain these concepts. Cheers!!
Thank you so much, you've help me get through the portion of class. 👍🏾👍🏾
guru dronacharya of data structure :)
anand satija 😂😂😂
Bro thank you so much and I wish u had good life up there
This is brilliant! Thanks! :)
You don't talk about deallocating the nodes after we're done with the list. Shouldn't that be done explicitly since we allocated them in the heap?
You're legend brother 🙏
One of the best tutorial...thank you sir...
Thank you so much, your videos are really very nice for learning Data Structures. Thank you, Sir for this beautiful learning gift.
thank you for making things simpler.
best explanation so far, thx a lot
please upload some lectures on dynamic programming
+mycodeschool why don't you make videos anymore sir :|
easily the best video tutorials i have seen :)
he is dead
Actually If am not mistaken, he is working at Google now, LOL
btw thanks to him, he made great videos, Indian Software Engineers are the best
Hey man! he is not joking, it really breaks my heart, such a nice person died in a hit and run case. Check out this link. He was one of the best programmers from India. RIP
yourstory.com/2014/06/techie-tuesdays-humblefool/
awewewewesome bro ,you have superb teaching experience ,aise hi machatte raha
isn't it more efficient to have a tail pointer (similar to head pointer) to traverse backwards?
We may or may not keep a tail pointer. Its good to keep a tail pointer, depends upon the use case. When we implement queue using doubly linked list, we keep a tail pointer. But in general, if we would have two links - forward and backward, that's what we would call a doubly linked list.
Thank you for easy explanation of linked list
is this a good approach , i just included a constructor which set next and prev to NULL , so that we dont need to worry about setting up next and prev while inserting a new node ?
struct node
{
node *next;
node *prev;
int data;
node()
{
next=NULL;
prev=NULL;
}
} *start=NULL,*temp,*end=NULL;
void insert_beg(int x)
{
temp = new node;
if(temp==NULL) exit(0);
temp->data =x ;
temp->next=start;
if(start!=NULL)
start->prev = temp;
start=temp;
if(end==NULL)
end=start; //initially
}
is this a good approach ? since now we need not worry about next and prev being NULL , since they would by default be pointing to NULL ... ?
thanks alot. This is very helpful. Please suggest how should i proceed for preparing competitive programming after going through all the data structure series and others available on mycodeschool
I am watching videos today and day after tomorrow I have data structure exam.
Very awesome class. But please reduce the time on the difference among the memory sections since it already introduced several times in previous lessons.
cleared my concept..thanks sir!!
your videos are helpful .I learned more good knowledge .
awesome videos broh..thanx a lot..how do u writ em ? lik wat software do u use..or what device ?
Thank you man , you're a life saver ...
Thank you very much for this video. It is really understandable!
Thank so much for the lesson.
It was very useful, thank you a lot
nice explation sir . from iit bombay cse
Kindly make a video on important operations on doubly linked list like insertion at middle ,deleting a node from middle etc
OMG thank you very much!!! This really helped me :)
You can use typedef struct
And then you can (node*) instead of (struct node*)
When the new node was created with the address 600 was it suppose to be | 0 | 4 | 0| ?
Thanks sir for explaining this topic
Thanks, I appreciated this a lot.
that was really amazing, .
BUT I AM QUITE WEAK AT THE BASICS, IS THERE ANY VIDEO OF YOURS WHICH WILL HELP ME CLEARING ALL MY BASICS FOR DATA STRUCTURES.
Thanks you for this wonderful video, how do we modify the code to use it us generic list, i try to use void pointer but i got an error on type casting it bc the data types can different in the same list?
Thanks again!!!
Great stuff you guys are producing i must say.
Have you guys posted videos on priority queues+heaps and Graphs?? If yes so any link you can provide?
i'm grateful for ur video
hi your video is very help ful to me can you please tell me what editor is you where using thanks
Great explanation!
sir ji u r great teacher
Thanks for uploading!
hello sir ,thank you for providing this videos. I didn't find videos of circular linked list could you please upload them.Thank you.
@13:37 please correct head value. it should be 600.:)
Wouldn't the use of malloc and not using free() cause a memory leak?
Good work sir, Thanks!
Also what do you mean by :
head -> prev = newNode;
newNode -> next = head;
head = newNode;
should we not write :
head = newNode;
newNode -> prev = head;
If you insert newNode at head, newNode->prev will always point to NULL because it's now first element in the list (a new head). The old head is becoming the second element of the list, that's why newNode->next must points to it and head->prev points back to newNode.
In your example head will be equal to newNode, newNode->prev will point back to newNode itself and newNode->next is already NULL. This way every time you're inserting node at head you're really throwing away the old head node so the list will always have one element - the last one you have inserted.
Clean explaination
Do you guys have the tutorials for python ?
Your tutorials are awesome...but i need it in python
Absolutely Amazing man!!!
Assignment - Inset at tail , Deletion
public void insertAtEnd(int data) {
Node newN = new Node(data);
if (head == null) {
head = newN;
previous = head;
} else {
newN.prev = previous;
previous.ref = newN;
previous = newN;
}
}
public void delete(int pos) {
Node current = head;
int traversalCnt = 0;
while (current != null) {
++traversalCnt;
if (traversalCnt == pos) {
if (current.prev == null) {
//moving head to next node
head = current.ref;
//updating 2nd nodes prev to null , else it will keep referring deletd node
current.ref.prev = current.prev;
} else {
//updating adjacent nodes
current.prev.ref = current.ref;
current.ref.prev=current.prev;
}
return;
}
current = current.ref;
}
}
Hi, you said that the newNode in GetNewNode is local to GetNewNode but previously you mentioned that the output or the node we get from the malloc function or new Node is global and so the newNode variable were we store the result of malloc should also be global. I am confused and the statement seems contradictory to me. Could you please help me with my confusion? Thanks.
Thank u very much, can i get answers if i asked about the above code please?
lecture on circular linklist is not present i n these lecture.
would you add them later ??
Hey ... are u facing some issues... U can contact me
Sir I was struggling initially but know I have understood the concept
Thanks
did you find the lesson on cicular linked list ?
@@thebaulbull how to contact you
nice explanation
hello thank you foe the video its awesome!
i have a question and its killing me, at 8:32 you're inserting InsertAtHead(2) and InsertAtHead(4) but in your drawing you have '2' in address 400 and '2' in address in 600 did you mean to put 4 ?? or are we replicating the Head with the val 2?
he mistakenly wrote 2 instead of 4
Instead of traversing list each to perform insert to delete operating, using a node pointer to tail(last node) would be efficient.
my reverse print method does not work.plz tell me the mistake-
void revprint(node **firstnode)
{
node *n=*firstnode;
while(n->next!=NULL)
{
n=n->next;
}
while(n!=NULL)
{
coutprev;
}
}
seems correct. but u should check if n is NULL first.
Hi bro,
When you implement the function "InsertAtHead(int x)", why don't we use the following implementation
//*********
head -> prev = newNode -> next;
newNode -> next = head -> prev;
head = newNode;
//*********
I know that is incorrect, but can you help to clarify my misunderstanding.
Thanks and Regards,
awesome compilation
in the 8.52 mins of the video we see how to add a new node to the non empty list. but we write
1.head->prev=newnode;
2.newnode->next=head;
3.head=newnode;
so my question is can we write newnode->next=NULL; instead of the 2nd statement?
hats off sir ji..
sir, for reverse print one can do:
void reversePrint()
{
temp = tail;
if(temp == NULL)
{
cout prev;
}
cout
but what is tail??
I mean we have not defined tail??
just as you save in head the first node of the list,
in tail you save the last node of the list
tail is pointer to last node , but we have only pointer to head node so we need to use a loop to go to last node assign pointer to it as tail and while(tail!=null){
print(tail.data);
tail=tail->prev;
}
this tutorial is amazing
Best tutorial ever!!!
Sir, please do Doubly circular linked list, as you promise. Thanks!
Did you find any? If yes, please share the links