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 ... 😍😍😍
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.
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/
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?
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 ... ?
Very awesome class. But please reduce the time on the difference among the memory sections since it already introduced several times in previous lessons.
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
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.
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; }
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.
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!
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
It's the best "data structures" tutorial list I've seen in the planet !
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.
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 cleared my technical interview after watching these video. Thanks for uploading these clear and precisely explained videos.
Sir, I can't even express how helpful your tutorials are to me. Thank you so much for making them!!
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!
Yaar bhai tum saviour ho,I can not thank you enough .Seriously.
this is the best DS video i have ever seen
Thank you so much humblefool, you make the world a better place.
Watching this video lectures should be made a part of the College curriculum.These videos helped me a lot during preparations for Exams.
10 years passed but this channel is helping students now also .
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]
this is the frst tutorial in which i see things explained via code, graphical representation and memory allocation process
10 years passed by and these explaination of concepts are Just like a WoW...
Thank you for every codeline of yours.
This is the very definition of a "clear code"
Thank you so much!
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.
Impeccable explanation!!! Cleared all the doubts what I had. I have no words to say thanks..
the best data structures playlist ever!
BEST Tutorials of DS...excellent explanation...supreme clarity and knowledge
guru dronacharya of data structure :)
anand satija 😂😂😂
many years but still watching thanks
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
u said u were gonna talk about circularly linked list . This is really an amazing playlist I wish this was more comprehensive. Thanksss :)))
Such a great teacher! Please come back
Thank you, finally getting to understand how DLL work
You're legend brother 🙏
Very awesome! I don't speak english very well but i have understood all... this is a very nice tutorial.
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.
you guy just amazing ..even my teacher can't explain like this
Videos are extremely clear and useful. Thanks a lot.
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;
}
}
sir where is the video for circular linked list?????
and thanks for ur videos helping me a lot
One of the best tutorial...thank you sir...
nice explation sir . from iit bombay cse
Bro thank you so much and I wish u had good life up there
Thank you so much, you've help me get through the portion of class. 👍🏾👍🏾
thank you for making things simpler.
Thank you for taking out time and making these videos. I really like the way you explain these concepts. Cheers!!
best explanation so far, thx a lot
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.
+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/
Thank you so much, your videos are really very nice for learning Data Structures. Thank you, Sir for this beautiful learning gift.
please upload some lectures on dynamic programming
I am watching videos today and day after tomorrow I have data structure 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?
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 ... ?
Very awesome class. But please reduce the time on the difference among the memory sections since it already introduced several times in previous lessons.
awewewewesome bro ,you have superb teaching experience ,aise hi machatte raha
Thank you for easy explanation of linked list
Thanks for uploading!
Great video!!!!!!!!!!!!!!!!
i'm grateful for ur video
Thank you man , you're a life saver ...
Clean explaination
You can use typedef struct
And then you can (node*) instead of (struct node*)
cleared my concept..thanks sir!!
#include
using namespace std;
struct node
{
int data;
node *next;
node *prev;
};
node *newnode,*head=0,*tail=0,*temp;
node *currentnode,*nextnode;
class linkedlist
{
int value;
int position;
int count;
public:
void insertelement()
{
coutvalue;
newnode=new node;
newnode->data=value;
newnode->next=NULL;
newnode->prev=NULL;
if(head==0)
{
head=tail=newnode;
}
else
{
tail->next=newnode;
newnode->prev=tail;
tail=newnode;
}
}
void traverse()
{
if(head==NULL)
{
coutprev=NULL;
head->prev=newnode;
newnode->next=head;
head=newnode;
}
else
if(position==( noofelements()+1) && head!=NULL)
{
newnode->data=value;
newnode->next=NULL;
newnode->prev=NULL;
tail->next=newnode;
newnode->prev=tail;
tail=newnode;
}
else
if( (position < noofelements() ) && head!=NULL)
{
int i=1;
temp=head;
while(inext;
i++;
}
newnode->next=temp->next;
newnode->prev=temp;
temp->next=newnode;
newnode->next->prev=newnode;
newnode->data=value;
}
else
coutprev=NULL;
head->next=NULL;
coutprev;
cout
your videos are helpful .I learned more good knowledge .
Great explanation!
Kindly make a video on important operations on doubly linked list like insertion at middle ,deleting a node from middle etc
@13:37 please correct head value. it should be 600.:)
very helpful tutorial ❤❤❤❤❤
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
hats off sir ji..
Thanks sir for explaining this topic
sir ji u r great teacher
Instead of traversing list each to perform insert to delete operating, using a node pointer to tail(last node) would be efficient.
awesome compilation
nice explanation
Thank you very much for this video. It is really understandable!
Absolutely Amazing man!!!
You are a saint.
Best tutorial ever!!!
if head is not global variable then this code is suitable:
struct Nodes* insertOnTail(struct Nodes *head1,int x){
struct Nodes *newnode=NewNode(x);
struct Nodes *head=head1;
if(head == NULL){
head=newnode;
return head;
}
while(head->next != NULL){
head=head->next;
}
newnode->prev=head;
head->next=newnode;
newnode->next=NULL;
return head1;
}
Thanks, I appreciated this a lot.
Thank so much for the lesson.
It was very useful, thank you a lot
OMG thank you very much!!! This really helped me :)
When the new node was created with the address 600 was it suppose to be | 0 | 4 | 0| ?
Good work sir, Thanks!
Wouldn't the use of malloc and not using free() cause a memory leak?
this tutorial is amazing
you are the king
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.
Thx helped a lot!
awesome videos broh..thanx a lot..how do u writ em ? lik wat software do u use..or what device ?
amazing you are great teacher
really solid thank you
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;
}
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.
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
/Inserting at end
void insertAtEnd(int x)
{
struct node* newNode= (struct node*)malloc(sizeof(struct node));
newNode->data=x;
newNode->next=NULL;
newNode->prev=NULL;
if(head==NULL)
{
head=newNode;
return;
}
struct node* temp= head;
while(temp->next!=NULL)
{
temp=temp->next;
}
temp->next=newNode;
newNode->prev=temp;
}
//End of inserting function.
Thank you very much... 👍
thanks animesh