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.
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!
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
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.
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 🙏🏻👍🏻
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
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.
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.
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.
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
first we will update the value of node which is occur after new node newnode->prev=temp; newnode->next=temp->next; temp->next->prev=newnode; temp->next =newnode;
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 🤔
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
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!
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;
0:10 create
13:55 insert at beg
17:17 insert at end
20:45 at pos
*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
Because of you I become developer from QA. Thanks... Best lecture of DSA
I wonder how could anyone dislike your videos.Your video is just amazing ma'am.
Pretty Good and Straight Explanation with out confusing students. Thanks.
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.
After your teaching I feel coding is easy in linked list . Thanks mam👍👍👌👌
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😂
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
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
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
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
her way of teaching is really good. Thank you mam for providing these lecture.
Third way:-
.
.
while(Inext;
}i++;
newnode->prev=temp;
newnode->next=temp->next;
temp->next->prev=newnode;
temp->next=newnode;
.
After Jenny teaching these concepts, we repeat the coding before her😂
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 ?
doubly linked list made easy !
Data Structures and Algorithms made easy ----> by Jenny Ma'am . ♥️♥️♥️
Your teaching way is very super mam, it's very amazing . I don't have a staff like yours.
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😂
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
Mee teaching very efficient gaa vundi mam
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 🙏🏻👍🏻
Watching 2024 September before one month exam still can't find any better explanation than these
A sincere gratitude to you 🙏 mam
great lectures for cs students thanks a lot
better quality lecture than university professor
Your concepts are much more helpful dear....
Love from Pakistan....
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?
The way of explaining is nice...keep rocking ☺️
31:37
3rd way
temp=newnode->next;
temp->prev=newnode;
yeah i did the same
Because I know Somewhere deep down in my heart I still love you
Love ur videos
Happy Janmanshtami....
God bless you !!!!
Let take tail as pos +1
Then
Newnode->next=temp->next
Temp->next =newnode
Newnode->prev=tail
Tail->prev=newnode
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)
love the way of your teaching! Damn Crush..💖 Love from Pakistan... Peace
#PKMKB
@@dipesh1401 ikmkb
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;
}
}
31:36 third way
{
newnode->next =temp;
newnode->prev=temp->prev;
temp->next = newnode;
temp=newnode->prev;
temp-> = newnode;
}
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.
Excellent Way of Explanation
In another way at insert atpos()
temp = newnode->next ;
temp->prev = newnode
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;
Thank You ma'am ! Please keep making videos,
17:06 insert at beginning
20:39 insert at end
شكرا جزيلا لك
Thank you sooo much ma'am ❤❤
Really appreciate ❤
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.
Mam teaches very nice and best understanding
Newnode->prev=temp;
Newnode->next=temp->next;
Temp->next->prev=newnode;
Tempo>next=newnode;
explained so smoothly , thank you ma'am
Literally excellent explain and teaching good
//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;
}
Thanks a lot mam
You are amazing mashallah Allah bless you 😊
❤️😊
Thankyou so much! your efforts in teaching reduces our effort in studying.
You make linkedlist like halwa.
No one can teach like u, special on youtube
Mam plz make videos on time complexity..
Yes mam plz make them
Nice explanation.....aapke jaise professors kyu nhi hote college m....😢😢
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
It's help me most in Ds .👍
THE ALTERNATE LOGIC FOR ADD NODE AT POS
newnode->prev=temp
newnode->next=temp->next
temp->next=newnode
newnode=newnode->next
newnode->prev=temp->next
Too good, Madam. Thanks a million.
Thankyou so much dearest mam ❤️❤️
Mam simply traverse the temp through the newly created node
temp=temp->next;
temp=temp->next;
Now write
temp->prev=newnode
Fabulous way of teaching 👌👌👏👏
wdym fabolous stop staring at maam
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.
Very helpful video,thank you ma'am.
Third way is temp->next->prev=newnode; and then temp->next=newnode;
Else if(pos>length (head)) {
Pf("length exceeded");
}
While i less than equal to pos -1 we can also write this on after pos.
Good practice: Always initialise a pointer with a NULL value.
Really excellent explanation mam
Superb Mam👍
❤thank u so much ma'am....for this great explanation 🪷
Nothing to say ..Just keep it up👏👏👌
Mam, may Aap sy bhot pyar krta hun, hrrat ap ki awaz sun k sota hun. love from AFGHANISTAN
last step is temp->next->prev = newnode
very well explained. thank u so much.
Nyc maam👏👏👏
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
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
first we will update the value of node which is occur after new node
newnode->prev=temp;
newnode->next=temp->next;
temp->next->prev=newnode;
temp->next =newnode;
yes..man
May Allah bless u always
Brahma*
what if we have to take the data from structure and then insert node after specific data given?
Make please make video on time complexity of code
insertatpos....3rd way
{
newnode->prev=temp;
newnode->next= temp->next;
temp->next->prev=newnode;
temp->next=newnode;
}
Ur explanation is same as ur beautiful face 😍😍 tq mam❤️
Thanks mam !
InsertAfterPos me
else if (pos == size_of_ll){
InsertAtEnd();
}
because we need to update tail also.
mam i have get segmentation fault error in addatend function,
Thank you so much for these videos
TH-cam goddess teacher ❣️❣️
Awesome teaching
//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.
Thank you very much for your great explanation on ds algo🤗
Temp->next->next->prev=newnode;
💙💙Ur explanation!!