i was about to give up on data structures... thank you mam for your superb detailed explanation videos which boosts up motivation and made my interest to learn more and more... now i get why these lectures are free, because no one else could afford to buy these priceless lecture.. thanks a lot mam...
CORRECTION: 1) in both delfrombeg() and delfromend() , we will write one more "if condition" to check if there is only one node in the list: if(head==tail) { head=tail=0; free(temp); } 2) in delfrompos() function , we will check for corner cases: if(pos==1) { delfrombeg(); } in else part after while loop we will check whether the node you want to delete is last node or not by writing: if(temp->next==0) { tail=tail->prev; tail->next=0; free(temp); }
Mam I think we should also have a condition like suppose we want to delete from position number 'm' then we should check from which end it is nearer (from head or tail) accordingly we will traverse from forward or backward. In test cases with large number of nodes this might be become handy
Thanks a lot maam. Now I can code singly & doubly linked list by my own. I am getting this confidence only because of you ma'am. Maam i have a request, i watched your all sorting algorithm videos, in heap sort you described us only max heap using examples..so I want if you kindly make a video on min heap too..
Hello mam!!! You are teaching soo soo soo good... I request you to mam for create a video playlist for JAVA and computer architecture..... And mam u Forgot To create forward videos of operating system so please mam work on it... I hope u will create in soon ... Thank u mam...
Great Efforts really appreciated thanks a lot first time after 15 years I am touching code and after the video I am able to write the code thanks a lot
Ma'am your explanation technic is mind blowing that is very suitable for anyone new to learn.... your idea of imparting knowledge through such type of tutorials is admirable. you are one of teacher who is teaching with clearing concept as well as genuine n deep points... These r helping me a lot. Thanq so much.
No doubt, there are some other teachers who are teaching Data Structure but mam the attribute which separates you from them is that you also teach us coding in Data Structure. Thankyou so much mam ;) Mam, can you please tell me how to prepare DS, DB, OS, CCNA mcq’s? Any reference mam.
Maam ...your explaining technique is owsm ....👌 And becoz of you only i clear my concept in all the topics in data structure ... 😊🤗 ..and we are very glad that we have teacher like you ... Keep it maam god bless you ..🤗
Mam your way of explaining and method of explaining concepts is really awesome and next level 👏👏👏 Very much thanks ro you mam for making these amazing videos for students like us....
temp=head; while(temp->next!=0) { temp=temp->next; } temp->prev->next=0; free(temp) ; Ma'am this code is correct or not for Deleting a node at end of the list in Doubly linked list
we can simply free(temp) without using temp->prev=0, because the node will automatically deleted once we use free function to clear the node ..(If I'm not wrong) I've tried this
Yes it's almost correct but you have to write one more condition for temp(1st node which you have to delete) because temp->next part has the value of head(2nd node after update) so you have to null that part too. Condition is : temp->next=0; Now you can free that temp node ... Free(temp)..
In function delfrombeg() Suppose we have only one node on the list you did not update tail pointer We can have dereferencing of null pointer in head->prev = 0; In function delfromend() Suppose we have only one node on the list you did not update head pointer In function delfrompos() check your edge cases
If I insert 8 elements ,and if I delete the 8th element I'm losing the last 2 elements or my program gets stopped,please clarify my doubt and reply asap Mam 🙏
Mam really I appreciate your knowledge you are so good mam.Mam I copy your code but in doubly linked list deletefromend function is not true I am getting error
My favourite mam I request to cover linked list all questions especially which is on geeks for geeks and if u want put this is in paid promotion of ur rs 59 but plz post it
mam why are u assigning i=1 in all the lectures by default in c programming the indexing start from 0 to n-1 so u have to assign i=0 .. to start traversing from zero index until pos-1 is achieved ...
question how can you delete a node from its data? in my case, I need to set data as an artists and ask the user to input an artist name, if that name coincides with any data or value of the node, delete it . Thank you so much!
i was about to give up on data structures...
thank you mam for your superb detailed explanation videos which boosts up motivation and made my interest to learn more and more...
now i get why these lectures are free, because no one else could afford to buy these priceless lecture..
thanks a lot mam...
same bro muje samaj hi nhi aa raha tha college me isliye maine soch liya tha DS mere liye nhi hai me kabhi nhi sikh paunga par ma'am ne bacha liya
CORRECTION: 1) in both delfrombeg() and delfromend() , we will write one more "if condition" to check if there is only one node in the list:
if(head==tail)
{ head=tail=0;
free(temp);
}
2) in delfrompos() function , we will check for corner cases:
if(pos==1)
{ delfrombeg();
}
in else part after while loop we will check whether the node you want to delete is last node or not by writing:
if(temp->next==0)
{ tail=tail->prev;
tail->next=0;
free(temp);
}
Mam I think we should also have a condition like suppose we want to delete from position number 'm' then we should check from which end it is nearer (from head or tail) accordingly we will traverse from forward or backward. In test cases with large number of nodes this might be become handy
I was just going to ask you the same thing in comments... 😂😂
@@nigampratap2466 wat do u think about using lenght of striing and tail for this case ????
in the delfrompos(), after checking the node is last or not.. can we call delfromend() in the if?
@@karrran yes we can call delfromend function
After watching your DS videos, I easily implemented it with Python.
It's helped me a lot.
Thanks Ma'am 👍
All the concepts are explained beautifully!
Would you create a " OOPS in Java " complete series too?
Thanks a lot maam. Now I can code singly & doubly linked list by my own. I am getting this confidence only because of you ma'am. Maam i have a request, i watched your all sorting algorithm videos, in heap sort you described us only max heap using examples..so I want if you kindly make a video on min heap too..
sure.. will upload soon
You are doing so great.... may Allah bless u always
Alla Nimmavan shatad tulla
Mam...U are Just Fire..like what the level of teaching
You explain each and every step in detail.It helps alot to solve the confusion.Thanks a lot for your hardwork.
Salute to you for a clear explanation. God bless you for your hard work Mam.
Hello mam!!!
You are teaching soo soo soo good...
I request you to mam for create a video playlist for JAVA and computer architecture.....
And mam u Forgot To create forward videos of operating system so please mam work on it...
I hope u will create in soon ...
Thank u mam...
Maam u are not allowed to explain so good😅.. This video just cleared all my previous doubts🙂🙂
Cringe
fr cringe af
@@sunnykumar-dg7gs naughty horrrha
Great Efforts really appreciated thanks a lot first time after 15 years I am touching code and after the video I am able to write the code thanks a lot
Mam we need more lectures from this tutorial. The way you have taken values for previous and next make it more easier for us to understand.
The best explanation which I’ve ever heard.
Thanks
Mam after listening your DSA videos,I got interest on learning CSE
Thank u very much mam😊
\\alternate method
delfromend()
:
temp=tail;
tail=temp->prev;
tail->next=0;
temp->prev=0; \\or (free(temp));
No need for 4th statement
Ma'am your explanation technic is mind blowing that is very suitable for anyone new to learn....
your idea of imparting knowledge through such type of tutorials is admirable.
you are one of teacher who is teaching with clearing concept as well as genuine n deep points...
These r helping me a lot.
Thanq so much.
No doubt, there are some other teachers who are teaching Data Structure but mam the attribute which separates you from them is that you also teach us coding in Data Structure.
Thankyou so much mam ;)
Mam, can you please tell me how to prepare DS, DB, OS, CCNA mcq’s? Any reference mam.
Thanks for teach us ds in easy English language..
Thanks a lot mam..
Help us always
Maam ...your explaining technique is owsm ....👌
And becoz of you only i clear my concept in all the topics in data structure ... 😊🤗 ..and we are very glad that we have teacher like you ...
Keep it maam god bless you ..🤗
You are the best teacher and your videos are very knowledgeable!!!👍
Thank you for a clear explanation on how the doubly linked list works!!
Hello madam
At 16:29 , while(I
Because of you ma'am I am able to clear all my doubts of linked list and now I can code very confidently...Thank you so much ma'am
best *lecture -> Jenny's lectures CS/IT NET&JRF
thanks for your superb lectures and also i thanks god for superb bueaty
Maybe split linked list (after given node , before given node)
and concatenation of linked list
It will be useful for divide and conquer algorithms
Thank you very much maam for the dedication in teaching complex topic for students and uploading videos for free. God Bless you!!
Ma'am you are so great
Very Important we should write temp==Null; after free(temp) or else temp pointer will be a Dangling pointer.
Mam your way of explaining and method of explaining concepts is really awesome and next level 👏👏👏 Very much thanks ro you mam for making these amazing videos for students like us....
Thank you so much. U make understand the concept very clearly
Mam you are teaching very good.please create playlist for C Programming lectures so that it will clear basics.
Understanding DATA STRUCTURES AND ALGORITHMS is difficult but don't worry
We have Jenny mam .
she made this as easy to understand
temp=head;
while(temp->next!=0)
{
temp=temp->next;
}
temp->prev->next=0;
free(temp) ;
Ma'am this code is correct or not for Deleting a node at end of the list in Doubly linked list
Most helpful video for me and my friends as well.
Thankyou mam
You explain so nicely :)
Your content and explanation is excellent, but it would be great if you guys try to reduce the length of the vedio
Mam why not
"while (i
we can simply free(temp) without using temp->prev=0, because the node will automatically deleted once we use free function to clear the node ..(If I'm not wrong) I've tried this
MAM Please e a dekhna thoda sa alag hai
#include
struct node
{
int data;
struct node *next;
struct node *prev;
};
struct node *head,*temp,*newnode;
int count=0;
int main()
{
int choice;
while(1){
printf("Enter choice :
1.Creat.\t2.insert at start.\t3.Insert at end.\t4.Insert at after location.\t5.Display.\t6.Exit
");
scanf("%d",&choice);
switch(choice)
{
case 1: creat();
break;
case 2: insertstart();
break;
case 3: insertend();
break;
case 4: insertloc();
break;
case 5: display();
break;
case 6: exit(0);
break;
default: printf("wrong choice");
break;
}
}
}
void creat()
{
newnode = (struct node*) malloc(sizeof(struct node));
printf("Enter data :
");
scanf("%d",&newnode->data);
newnode->prev = 0;
newnode->next = 0;
if(head==0){
head = temp = newnode;
newnode->prev = 0;
newnode->next = 0;
count++;
}
else{
temp->next = newnode;
newnode->prev = temp;
newnode->next = 0;
temp = newnode;
count++;
}
}
void insertstart()
{
newnode = (struct node*) malloc(sizeof(struct node));
printf("Enter data :
");
scanf("%d",&newnode->data);
newnode->prev = 0;
newnode->next = 0;
if(head==0){
head = temp = newnode;
}
else{
head->prev = newnode;
newnode->next = head;
newnode->prev = 0;
head = newnode;
}
}
void insertend()
{
temp = head;
newnode = (struct node*) malloc(sizeof(struct node));
printf("Enter data :
");
scanf("%d",&newnode->data);
newnode->prev = 0;
newnode->next = 0;
if(head==0){
head = temp = newnode;
}
else{
while(temp->next!=0){
temp = temp->next;
}
temp->next = newnode;
newnode->prev = temp;
}
}
void insertloc()
{
int i=1,pos;
temp = head;
printf("Enter position :");
scanf("%d",&pos);
if(pos==1){
insertstart();
}
else if(pos>count){
printf("Invalid position!");
}
else{
newnode = (struct node*) malloc(sizeof(struct node));
printf("Enter data :
");
scanf("%d",&newnode->data);
newnode->prev = 0;
newnode->next = 0;
while(inext;
i++;
}
newnode->prev = temp;
newnode->next = temp->next;
temp->next = newnode;
temp->next->prev = newnode;
}
}
void display()
{
temp = head;
while(temp!=0){
printf("%d ",temp->data);
temp = temp->next;
}
}
Very helpful video,thank you ma'am.
Thank you for this well explained video
for deletion at beginning is this logic correct?
temp=head
head-=head->next
head->previous = null
free(temp)
yes it seems like
Yes it's almost correct but you have to write one more condition for temp(1st node which you have to delete) because temp->next part has the value of head(2nd node after update) so you have to null that part too.
Condition is : temp->next=0;
Now you can free that temp node ...
Free(temp)..
Thank You ma'am for this lecture
Nice Teaching Mam!
Thank you so much ma'am
Please make a video on merge sort
Mam we have to set temp->next=0.. Otherwise temp will connected with the next node as a singly linked list.. Ri8??
Simply super mam
Thanks a lot ma'am 🔥🔥💯💯👍
In function delfrombeg()
Suppose we have only one node on the list
you did not update tail pointer
We can have dereferencing of null pointer in head->prev = 0;
In function delfromend()
Suppose we have only one node on the list
you did not update head pointer
In function delfrompos()
check your edge cases
noted.. and I have written the corrections too.. :)
Me gusta como explicas ! Saludos desde colombia.
Sus....
ty mam programs made so easy 💕💕
Really thank you so mucn madam
Great job! Thank you and God bless 🙏 🕊✝️
Guys without using temp, I think we can free memory of nodes using head or tail pointers themselves right?? in case of deletion at begin and end.
thankyou maam, this is very helpful
Mam this code will work when only one node in the list ???
If I insert 8 elements ,and if I delete the 8th element I'm losing the last 2 elements or my program gets stopped,please clarify my doubt and reply asap Mam 🙏
❤thank u mam from deep of my heart, ur like a goddess
Mam really I appreciate your knowledge you are so good mam.Mam I copy your code but in doubly linked list deletefromend function is not true I am getting error
Day 16 completed
inspirational stuff!
Explain the procedure of inserting an element after the specified position of the doubly linked list and also write the program for that operation.
Is it mandatory to free any node after unlinking
My favourite mam I request to cover linked list all questions especially which is on geeks for geeks and if u want put this is in paid promotion of ur rs 59 but plz post it
Hello Mrs ! Can I use delete in stead of free if I am using C++ ? Thank you very much
👍🙂 very nice video
Nicely explained 👍🏻
Thank you so much mam 😘😘
Deletion would be easier with search function (Delete node with given key value)
Before deallocate or free the required node should we store the data of this node or not.
you are amazing teacher thank you it helped me a lot
Ma'am can we write it like
Temp=tail
Tail->next=0
Free(temp)
//deletion in doubly linked list
#include
#include
struct node{
int data;
struct node *prev,*next;
};
struct node *head=NULL,*temp,*tail,*newnode;
// display function
void display() {
temp = head;
while (temp != NULL) {
printf(" %d\t ", temp->data);
temp = temp->next;
}
}
// deletion from beg;
void delbeg(){
if(head == tail){
head=tail=0;
free(temp);
}
else{
temp=head;
head = head -> next;
head -> prev = 0;
free(temp);
}
printf("Updated doubly ll: ");
display();
}
void delend(){
if(head == tail){
head=tail=0;
free(temp);
}
else{
temp=tail;
tail = tail -> prev;
tail -> next = 0;
free(temp);
}
printf("Updated doubly ll: ");
display();
}
int getlength(){
int length=0;
temp=head;
while(temp!=NULL){
temp=temp->next;
length++;
}
return length;
}
void delatpos(){
int pos,i=1;
int len=getlength();
printf("Enter position: ");
scanf("%d",&pos);
if(pos>len || posprev->next = temp->next;
temp->next->prev = temp -> prev;
free(temp);
printf("Updated doubly ll: ");
display();
}
}
int main(){
int choice = 1;
while(choice){
newnode = (struct node*)malloc(sizeof(struct node));
printf("Enter data: ");
scanf("%d",&newnode->data);
newnode->next = NULL;
newnode->prev = NULL;
if(head == NULL){
head=tail=newnode;
}
else{
tail->next=newnode;
newnode->prev=tail;
tail=newnode;
}
printf("Do you want to continue press 1 otherwise 0: ");
scanf("%d",&choice);
}
printf("Values of Doubly ll: ");
display();
printf("
Press 1 to delete a node in the beginning, 2 to delete a node at the end, and 3 to delete a node at a given position: ");
scanf(" %d",&choice);
switch (choice){
case 1:
delbeg();
break;
case 2:
delend();
break;
case 3:
delatpos();
break;
default:
printf("Input not valid.");
}
return 0;
}
Run ho raha hai kya?
@@shree_275 hmm
M'm please, make video on stack &queue,
mam from this code the last node is not deleted
Tnq so much mam
what a explanation
very helpful
ty ma'am
Thank you sooo much mam ❤️
Can we write in this way for deleting a node in the end
Logic part
While (temp->next!=NULL)
{
temp=temp->next;
temp->prev->next=NULL;
}
Here , won't we write choice for continue??if yes,then where ??
can you do deletion from before and after a node i am having problem doing those
deletion @ end
// its else condition statement
else
{
tail -> prev=temp;
temp ->next=NULL;
free(tail);
tail=temp;
}
it's possible
mam pls show full coderunning in editor so that i know where i did mistake
thanks a lot maam .
can i do this is using only temp pointer alone mam?
Thanks mam
mam why are u assigning i=1 in all the lectures by default in c programming the indexing start from 0 to n-1 so u have to assign i=0 .. to start traversing from zero index until pos-1 is achieved ...
It's upto you you can set i =0 i.e. you are referring the first node as position 0 and then you can change the condition accordingly
maam if we free temp then how we traverse the linklist??
Mam,i have a ques ..The way we use tail pointer in the doubly link list can we use it in singly link list also.
softwareengineering.stackexchange.com/questions/301862/should-linked-lists-always-have-a-tail-pointer
thanks
Mam pleasee explain tail pointer in del from end. How it is storing, how we are accessing it.
Please Explain
Mam in deletion for any position can we traverse tha list from tail side also? because nodes has double links ..can we mam?
mam how did you initialize tail.
we cannot initialize tail to 0 like head .
how did you know the last element address to store that in tail
how can we simplfy temp->prev->next plz can i write in a different way?
Yes.....I was also thinking of that only becz this is easy as compare to that
question how can you delete a node from its data? in my case, I need to set data as an artists and ask the user to input an artist name, if that name coincides with any data or value of the node, delete it .
Thank you so much!