currently studying data structures in my summer vacation and so far im doing great understanding all the concepts of singly and insertion of doubly linked lists! Learning from a great teacher feels like we are learning magic!
My friend said to me that in c or c++ programming linked list is very hard than any topics but when i watch your every lecture i feel that linked list is very easy than others topics.
3rd way of inserting newnode->next=temp->next; temp->next->prev=newnode; newnode->prev=temp->next; temp->next=newnode; thank you mam, because of you i'm able to understand each and every concept clearly.👨🎓
*temp logic in create node and *tail logic sounds very similar.... but best clear and explanation compare to my other youtube videos. I think I found my youtube professor. thank you~!
Maam as you explained in one video where we used prev pointer and temp pointer to insert at a given pos in singly linked list , so i have tried to apply it in doubly linked list using a pointer name save and applied following operation: while(inext; i++; } nn->next=save->next; //nn is newnode temp->prev=nn; save->next=nn; nn->prev=save; Thank you for explaining everything at such a precise lvl.
insert at beginning & insert at end and delete at beginning & delete at end, are symmetrical. Just switch these terms with one another head tail next prev
Dear mam, please correct me if i am wrong, when i want to insert a node at a positon, can;t we do in this way that we take a extra pointer lets say a, and then while we are traversing , we can keep our condition for while loop as i NEXT = new_node, new_node -> prev = a new_node-> next = temp, new_node -> data = data. Please correct me if i am wrong
A genuine advise for newbies...if you haven't watch single linked implementation and insertion at different places video .... first watch that. Then it would be too easy to you to get the logic. Then you would also know that you can use temp instead of tail and won't be confused. Go watch the single linked list implementation first 🙏🏻👍🏻
Also in the insertafterpos we should include the part if (pos==size) , i.e, the node will be added in the last position and we have to change our tail pointer.
YES!! Their is one another way without using the concept of double pointer. Which is - updating the value of temp i.e temp = newnode -> next ; newnode of next containing the value of nextnode i.e 200 so, temp = 200. Then, updating the value of temp of prev i.e temp -> prev = newnode ; new node containing 500. So, 500 assign to the temp of prev. If my logic is RIGHT please reply me .Thank you.
Mam please show us the total compilation and output in a code editor and make a seperate video because while typing code myself it is not executing at all. Please 🙏😭
Hello maam, I had one doubt regarding head or temp pointer in general. See head, temp or even newnode are of type struct node, so when we declaire them they are pointing to memory location of srtuct node containing space for data, *prev & *next. So when we simply write head = temp = newnode ; then how compiler know that in what pointer space (prev or next ) address of newnode is to be stored . See this doubt arrived with Dll as in SLL there was space for one address only. It will be nice if you solve this query thank you
ma'am while adding at the end I thought u should also [rovide the code for the data where there is no data in the linked list. Thank you for this wonderful video with that much simplicity loved the way of your teaching.
is this the third way cause, The very first time i thought of logic was this newnode->next = tail newnode->prev = temp; tail->prev = newnode; temp->next = newnode; Is this right ?
Mam,Thank you so much.🥰 Your Explanation is just awesome, i can understand every point and you have cleared every single concepts 🥰 Best CS teacher i have ever seen. Soon we will be a family of 1M subscribers❤️
I found insertion for sorted singly linked list I updated tail pointer and connected prev pointers and it works for doubly linked list but one of the traversal pointers can be eliminated To get rid this extra pointer insert before will be useful What cases should we consider when inserting before given node etc
Also in the insert at pos function we need to separately mention the condition that if position=size +1 , that is the user wants to enter the data at last position, then we have to call the insert at end function, bcoz in this case we need to update the tail pointer also.
Nice explanation ....add one more thing in these linklist videos ... how to inset null/ Zero at last node 's next address and to print the entire link list with data , current address and next address
This is 2024 and still this series can teach you better DSA than any BIG Universities colleges or professors.
Literally IIT level teaching one of the brilliant teacher I have seen yet thanku so much mam 🤗
You will also never see like her.
😝
IIT's don't teach well 😕
Habhaii mam ka DSA KA VIDEO KAFII HAII FOR GATE
Bhai kabhi IIT me pdai kre ho ky ho bol rahe IIT level ki pdai 🤔
31:35 Third way
newnode->prev = temp;
temp->next->prev = newnode;
newnode->next = temp->next;
temp->next = newnode;
currently studying data structures in my summer vacation and so far im doing great understanding all the concepts of singly and insertion of doubly linked lists!
Learning from a great teacher feels like we are learning magic!
My friend said to me that in c or c++ programming linked list is very hard than any topics but when i watch your every lecture i feel that linked list is very easy than others topics.
every subject is very very easy if the teacher is like jenny ma'am...😇🥰
Yep
Yes
3rd way of inserting
newnode->next=temp->next;
temp->next->prev=newnode;
newnode->prev=temp->next;
temp->next=newnode;
thank you mam, because of you i'm able to understand each and every concept clearly.👨🎓
newnode->prev=temp;
*temp logic in create node and *tail logic sounds very similar....
but best clear and explanation compare to my other youtube videos.
I think I found my youtube professor. thank you~!
Congrats brotha
0:10 create
13:55 insert at beg
17:17 insert at end
20:45 at pos
Because of you I become developer from QA. Thanks... Best lecture of DSA
After your teaching I feel coding is easy in linked list . Thanks mam👍👍👌👌
I wonder how could anyone dislike your videos.Your video is just amazing ma'am.
Maam as you explained in one video where we used prev pointer and temp pointer to insert at a given pos in singly linked list , so i have tried to apply it in doubly linked list using a pointer name save and applied following operation:
while(inext;
i++;
}
nn->next=save->next; //nn is newnode
temp->prev=nn;
save->next=nn;
nn->prev=save;
Thank you for explaining everything at such a precise lvl.
Pretty Good and Straight Explanation with out confusing students. Thanks.
literally the best teacher that i ever seen... sometimes i thought of sharing this to my lecturers, so that they can learn and will teach to us😂
You are the "Best" Lecture ever. I had zero knowledge of DSA, but now I am learning a lot from you. Million thanks ma'am😍🤩🥰 Love from Karnataka!!
you are from non-CS background?
@@sktausifrahman1496 yes
@@kavyag6326 me too
That smile 😄 at the end of the lecture gives a energy to continue learning
I have ds in 3rd sem u have helped me a lot💖
same here
Same bro.
My 2nd sem bca
@@savaliyanisargrameshbhai8922 hahahahahhhaaaa
me in 2nd sem😥😰 btech
So , conclusion is , we were declaring temp locally in all function.
Tail is doing the work of temp , but tail is declared globally .
Yes
What if I declare temp locally and do the same work using it.. so will it be fine?
@@shrutirohila7869 Yeah or you can declare it globally once and use throughout the program..
@@normalpeople3441ok..thanks
@@shrutirohila7869 there is no need of tail.insertion can e done without tail also
She made dsa easier for every student. Thank you madam
Third way:-
.
.
while(Inext;
}i++;
newnode->prev=temp;
newnode->next=temp->next;
temp->next->prev=newnode;
temp->next=newnode;
.
insert at beginning & insert at end and delete at beginning & delete at end, are symmetrical. Just switch these terms with one another
head tail
next prev
Insertion after position while(i
you explain it like you sit inside the pc and your the compiler of c++ . i learned so much from your videos thanks for all video
Wah bete wah😂
Very good explaining mam keep it up thanks much a lot from Pakistan province punjab your smile is very awesome
Awan sahib punjab from where ?
Dear mam, please correct me if i am wrong, when i want to insert a node at a positon, can;t we do in this way that we take a extra pointer lets say a, and then while we are traversing , we can keep our condition for while loop as i NEXT = new_node, new_node -> prev = a new_node-> next = temp, new_node -> data = data. Please correct me if i am wrong
that's what mam said in video you can take another pointer if you want! But this don't do anything except increasing the space of program.
Watching 2024 September before one month exam still can't find any better explanation than these
A sincere gratitude to you 🙏 mam
After Jenny teaching these concepts, we repeat the coding before her😂
Your teaching way is very super mam, it's very amazing . I don't have a staff like yours.
The way of explaining is nice...keep rocking ☺️
Your concepts are much more helpful dear....
Love from Pakistan....
doubly linked list made easy !
Data Structures and Algorithms made easy ----> by Jenny Ma'am . ♥️♥️♥️
A genuine advise for newbies...if you haven't watch single linked implementation and insertion at different places video .... first watch that. Then it would be too easy to you to get the logic. Then you would also know that you can use temp instead of tail and won't be confused.
Go watch the single linked list implementation first 🙏🏻👍🏻
Mee teaching very efficient gaa vundi mam
love the way of your teaching! Damn Crush..💖 Love from Pakistan... Peace
#PKMKB
@@dipesh1401 ikmkb
thank you so much for this video.But there was no difference in the temp and tail pointer(temp pointer used in your earlier lacture)
Also in the insertafterpos we should include the part if (pos==size) , i.e, the node will be added in the last position and we have to change our tail pointer.
We need to put condition
else if (pos == Size_Of_LL){
InsertAtEnd();
}
I hope it is helpful
There is a mistake in while loop of insert after position. Instead of while(i
No there is no need for equal sign in the condition. You can dry run and then check
Because I know Somewhere deep down in my heart I still love you
Love ur videos
Happy Janmanshtami....
God bless you !!!!
Nice explanation.....aapke jaise professors kyu nhi hote college m....😢😢
great lectures for cs students thanks a lot
better quality lecture than university professor
YES!! Their is one another way without using the concept of double pointer. Which is -
updating the value of temp i.e
temp = newnode -> next ;
newnode of next containing the value of nextnode i.e 200 so, temp = 200.
Then, updating the value of temp of prev i.e
temp -> prev = newnode ;
new node containing 500. So, 500 assign to the temp of prev.
If my logic is RIGHT please reply me .Thank you.
Newnode of next is 0
31:37
3rd way
temp=newnode->next;
temp->prev=newnode;
yeah i did the same
Fabulous way of teaching 👌👌👏👏
Mam teaches very nice and best understanding
Excellent Way of Explanation
Thank you sooo much ma'am ❤❤
Really appreciate ❤
Thanks a lot mam
You are amazing mashallah Allah bless you 😊
❤️😊
Thankyou so much! your efforts in teaching reduces our effort in studying.
Thanks mam !
InsertAfterPos me
else if (pos == size_of_ll){
InsertAtEnd();
}
because we need to update tail also.
Thank You ma'am ! Please keep making videos,
mam can we insert node without using the tail like we done in single linked list by making some logical change by our own
You can but time complexity will be O(n)
@@sakthivigneshvar4428 so how you will implement tail pointer at the end of the linked list?
Then you have to traverse from head to end again
@@LP-ih2ye No need to traverse, you can simply make tail's next as newnode and that newnode as tail, which is why it is O(1)
@@sakthivigneshvar4428 if you don't mind can you please write the code of inserting at end 🙂?
@@LP-ih2ye Yeah ok, for doubly linked list:
newnode->next = 0;
newnode->prev = tail;
tail->next = newnode;
tail = newnode;
For singly linked list, just write:
newnode-next = 0;
tail-next = newnode;
tail = newnode;
Mam simply traverse the temp through the newly created node
temp=temp->next;
temp=temp->next;
Now write
temp->prev=newnode
شكرا جزيلا لك
Literally excellent explain and teaching good
Newnode->prev=temp;
Newnode->next=temp->next;
Temp->next->prev=newnode;
Tempo>next=newnode;
Mam, may Aap sy bhot pyar krta hun, hrrat ap ki awaz sun k sota hun. love from AFGHANISTAN
In another way at insert atpos()
temp = newnode->next ;
temp->prev = newnode
It's help me most in Ds .👍
Mam plz make videos on time complexity..
Yes mam plz make them
explained so smoothly , thank you ma'am
You make linkedlist like halwa.
No one can teach like u, special on youtube
If you guys are watching the videos in series, then start this video at 14:00, till then previous lecture has been repeated only.
Actually she has explained about the use of tail pointer till this which wasn't mentioned earlier
@@sahilprasantachoudhury911 but I think that tail and temp has a lot similarity in them...
@@biswajitsahoo1456 yes,but it's better to get all the steps clarified right?
Mam, when we are inserting at the end ,we are traversing the whole linkedlist ,so why time complexity would be O(1)???
Really excellent explanation mam
Else if(pos>length (head)) {
Pf("length exceeded");
}
Mam please show us the total compilation and output in a code editor and make a seperate video because while typing code myself it is not executing at all. Please 🙏😭
learn algorithm not code
//by creating another pointer. which will be pointing towards temp->next
void insert_at_pos()
{
node *head, *newnode, *temp, *thptr;
newnode = (node *)malloc(sizeof(node));
cout newnode->data;
int pos, i = 1;
cout pos;
temp = head;
while (i < pos - 1)
{
temp = temp->next;
}
thptr =temp->next;
temp->next=newnode;
newnode->prev=temp;
newnode->next=thptr;
}
Let take tail as pos +1
Then
Newnode->next=temp->next
Temp->next =newnode
Newnode->prev=tail
Tail->prev=newnode
Thankyou so much dearest mam ❤️❤️
Hello maam,
I had one doubt regarding head or temp pointer in general. See head, temp or even newnode are of type struct node, so when we declaire them they are pointing to memory location of srtuct node containing space for data, *prev & *next. So when we simply write head = temp = newnode ; then how compiler know that in what pointer space (prev or next ) address of newnode is to be stored . See this doubt arrived with Dll as in SLL there was space for one address only.
It will be nice if you solve this query
thank you
ma'am while adding at the end I thought u should also [rovide the code for the data where there is no data in the linked list.
Thank you for this wonderful video with that much simplicity loved the way of your teaching.
Make please make video on time complexity of code
31:36 third way
{
newnode->next =temp;
newnode->prev=temp->prev;
temp->next = newnode;
temp=newnode->prev;
temp-> = newnode;
}
❤thank u so much ma'am....for this great explanation 🪷
Mam please make videos on C programming .It will be helpful for BE 1st year students.
this is C programming Structures mam hehehe this is advance
@@iverpunayan7308 People say lie C Programming is wonderful until we met Data Structures
Awesome teaching
Too good, Madam. Thanks a million.
is this the third way cause, The very first time i thought of logic was this
newnode->next = tail
newnode->prev = temp;
tail->prev = newnode;
temp->next = newnode;
Is this right ?
Mam,Thank you so much.🥰
Your Explanation is just awesome, i can understand every point and you have cleared every single concepts 🥰
Best CS teacher i have ever seen.
Soon we will be a family of 1M subscribers❤️
I found insertion for sorted singly linked list
I updated tail pointer and connected prev pointers
and it works for doubly linked list but one of the traversal pointers can be eliminated
To get rid this extra pointer insert before will be useful
What cases should we consider when inserting before given node etc
Very helpful video,thank you ma'am.
Mam this creation with tail is totally same as temp,, only we uses tail instead of temp
Yes
17:06 insert at beginning
20:39 insert at end
in insertion at position you talk about predefined function length but in c i don't think so that there is any predefined function length
Mam explain the concept without using tail pointer with program in insertion at end
For Java :
//function to insert data in doubly linked list(default end)
public void append(int data) {
Node node = new Node(data);
Node temp = head;
if(head == null) {
head = temp = node;
return;
}
else {
while(temp.next != null) {
temp = temp.next;
}
temp.next = node;
node.prev = temp;
}
}
//function to insert data in start of doubly linked list
public void push(int data) {
Node node = new Node(data);
node.next = head;
//node.prev = null;
if(head == null) head = node;
else {
head.prev = node;
node.next = head;
head = node;
}
}
//function to insert at a given position
public void insert(int pos, int data) {
if(pos < 1 && pos > length()) System.out.println("Invalid position to insert.");
else if(pos ==1) push(data);
else {
Node node = new Node(data);
Node tempNode = head;
int count = 1;
while(count < pos-1 && tempNode.next != null) {
tempNode = tempNode.next;
count += 1;
}
node.prev = tempNode;
node.next = tempNode.next;
tempNode.next = node;
if(node.next != null) node.next.prev = node;
}
}
Also in the insert at pos function we need to separately mention the condition that if position=size +1 , that is the user wants to enter the data at last position, then we have to call the insert at end function, bcoz in this case we need to update the tail pointer also.
can you send me the code?
If (pos==size+1)
{ delfromend();
}
The delfromend function that we have written previously will accordingly update the tail pointer.
//alternate method
newnode->prev=temp;
newnode->next=temp->next;
temp->next->prev=newnode;
temp->next=newnode;
@Rahul , I think in 3rd line
if( temp->next != null) temp->next->prev = newNode;
should be the case, otherwise it can give null pointer exception.
mam..
can we insert at pos=4 intead of writing invalid condition
else if(pos==count+1)
{
insertatend( );
}
Thank you very much for your great explanation on ds algo🤗
very well explained. thank u so much.
Nothing to say ..Just keep it up👏👏👌
While i less than equal to pos -1 we can also write this on after pos.
Ur explanation is same as ur beautiful face 😍😍 tq mam❤️
we can use temp instead of tail right because the temp is at end. isnt it a right thing
hi bro can you send me the complete code
i am facing lot of issue
last step is temp->next->prev = newnode
Nice explanation ....add one more thing in these linklist videos ... how to inset null/ Zero at last node 's next address and to print the entire link list with data , current address and next address
Why not using tail pointer in insert at pos() to reach last node
mam can you solve previous year wuestion of linklist ,queue point of gate our logic is not buildup how we can sol wuestion pls reply