All the video lectures and the articles helped me a lot to gain confidence in DSA and will be helping me in the interviews. Thank you Striver bhaiya for bringing such amazing content for free.
@@sunitasharma3016 I am 2024 graduate, and currently I'm working as a software developer in a company with 5 LPA. And striver only responsible to get me there. One advice to all is follow his content blindly ❤️
idk why but really hats off to you , after learning The first thirteen minutes of content i got so confident that i promptly went for solving LRU Cache 😂 ( though couldnt solve it , i will definitely do after watching the complete content ) but i am now confident on my Linear DS Primers !!! Thank You
@38:46 If k is out of bound adding below code after while statement would cover that scenario if (kNode == null) { return head; // K is larger than the length of the list }
Great work sir, iske baad String ki playlist aa jaye toh accha rahega kyunki baaki TH-cam ne String utna deep dive kiya nhi in terms of algorithms and questions. So, if possible please bring string playlist in near future. Thanks ❤
strings are vast , no matter how much ever we solve there can still be a question which we may not be able to do , instead ask for stack queue or heaps , greedy etc
@@codeguy21 stacks, queues or heaps are easier topic. There are 4-5 patterns on each if you understand the pattern you can solve. Also many other TH-camrs have taught these topics. But string is something that is not much touched yet and is also important in terms of interview. I myself faced string questions in 7 interviews out of 10.
00:04 Doubly linked list allows traversal in both directions. 02:03 Doubly linked list stores data and points to both next and previous nodes. 06:21 Adding a new node to the doubly linked list 08:35 Creating a doubly linked list from an array 13:11 Converting array to doubly linked list 15:11 Deleting from a doubly linked list with multiple elements 19:20 Implementing delete operations on a doubly linked list. 21:17 Ensure the new tail of the linked list points to null and disconnect from the previous element. 25:21 Deleting elements from a doubly linked list 27:22 Traversing a Doubly Linked List to find the kth node 31:46 Handling deletion in Doubly LinkedList 33:55 Deleting a node in a Doubly LinkedList 37:57 Deleting a given node from a doubly linked list involves changing pointers. 40:00 Explaining how to delete a node in a Doubly LinkedList 44:06 Learning about insertion of nodes in doubly linked list. 46:19 Inserting before head and tail of a linked list 50:19 Inserting before the tail in a doubly linked list. 52:27 Inserting before the Kth node of a linked list 56:51 Inserting before a given node in a Doubly LinkedList 58:50 Understanding insertion of nodes in a doubly linked list 1:02:40 Deletion of tail using Doubly LinkedList Crafted by Merlin AI.
Hello Striver Bhaiya , I have doubt in a specific part of the code . My doubt is in inserting a node at Kth node problem. Like I am thinking of an edge case in which if(head == NULL) && (head == NULL) which basically mean list is empty and list has only 1 element respectively right and if (K > 1) which basically mean it is telling us to insert a node at the position where node is not available right and then for that we have to return NULL . So, basically I wanted to tell my point on this case , I know you would have also tell that point but might have forgetten while teaching. By the way Thank You Bhaiya for creating this wonderful DSA playlist , it really really helped me. Hope in future I could meet you in person. Thank You Bhaiya
I want to point out a small mistake aside from that the tutorial is fire. when you are deleting head make sure there is a node present when moving the pointer because you have to make the prev pointer of the next node null. This issue can occur when there is only one element present in DLL
for deleting the kth node, suppose if DLL length is 4 and my k=8, the while loop will stop when temp is the last node, making prev as second to last node, and front will become the nullptr, that means even though k is beyond the length of linked list , we still removed the last node because front was null
For doing deletionAtTail instead of storing back in another Node we can just do tail.back.next. Anyone reading the comment correct me if I'm wrong. Great explanation and superb playlist
for the part tail deletion we can simply traverse to the last node and do temp->back->next = nullptr in cpp and can simply do it in one line and wont be making a new temporary variable to store previous Node *DeleteTail(Node *head) { if (head == nullptr) { return nullptr; } // if the list has only one node if (head->next == nullptr) { delete head; return nullptr; } Node *temp = head; while (temp->next != NULL) { temp = temp->next; } temp->back->next = nullptr; temp->back = nullptr; // its not compulsary to do as we delete temp delete temp; return head; }
@ 18:54 at line 47 what if i not write prev->next =nullptr and straight away write delete prev will the link between prev and head will be removed automatically or its necessary to remove link between prev and head manually.
46:11 the function name insertBeforeHead is misleading if we’re handling the case where head might be NULL. When head is NULL, there’s technically no "head" to insert before. Otherwise, top-notch video :)
hey striver, thanks for the series. do we have to assign prev->next = nullptr? as we are eventually deleting prev itself, will the next pointer cause any problems?
just a small doubt is: that in the question of deleting the node of a DDL at time 43:09, the node to be deleted was given as argument, so just i want to know is that do by providing the node as an argument and not traversing to get it and then putting the logic for deletion, the note gets deleted or it is because you have continued the different operations in one program
hey striver in removeKelement dont you need to have a flag to check whether the while loop is terminated when kNode==NULL or cnt becomes == k. I mean there are two conditions through which we can come out of while loop. Lets say k==5 then we come out of it when kNode becomes ==NULL and then in the next step you are writing Node* prev=knode->back, so i think here we will get error
In the remove kth problem, if we will remove the first element only if k=1 and same goes for last element if k = size of LL then only we will remove it right? then why are we doing those edge cases at the start?
Someone solve my doubt At 17:53 in C++ , if we are deleting prev , then there is no need to write prev->next=nullptr, right? cause we are gonna delete prev anyways so there should be no need to chnage its next
I understand the deletion at 17:53, However, if you don't mind me asking why exactly are we trying to do "prev -> next = NULL", will simply "delete prev" not delete the values of next and back associated with it as well?
@arshpathak1894 The reason for doing is that we don't want to waste our memory so we will pointing it to null bcoz if the node is of no use then there is no sense in pointing it to some other node
@@neerkhandor5007that wasn't what I was asking, am saying there is no need to take care of dangling pointers by making them explicitly point to NULL when you are going to delete the object itself of which that pointer is an instance of.
Hope striver is doing extremely well ❤
"extremely" echoed in my brain for 10s
also a hope striver is doing extremely well ???
Doubly Linked List - 1:25
Representation of DLL - 2:47
Array to DLL (CPP) - 4:00
Array to DLL (Java) - 12:14
Delete head DLL(cpp) - 14:32
Delete head DLL(Java) - 19:24
Delete Tail DLL (cpp) - 20:15
Delete Tail DLL (java) - 24:50
Delete Kth (cpp) - 25:41
Removing given node - 39:43
Insert node before (head) - 44:54
Insert node before (Tail) - 47:25
Insert node before (kth node) - 52:40
Insert before given node - 58:00
All the video lectures and the articles helped me a lot to gain confidence in DSA and will be helping me in the interviews. Thank you Striver bhaiya for bringing such amazing content for free.
bhaiya aap konse year mein ho
@@sunitasharma3016 I am 2024 graduate, and currently I'm working as a software developer in a company with 5 LPA. And striver only responsible to get me there. One advice to all is follow his content blindly ❤️
@@sunitasharma3016 2nd
You making the DSA like everyday its a cup of tea , what a man.... >>>>>> any paid courses
Even inserting before parts felt easy to me and I coded those by myself. Thanks striver! you have been an awesome teacher.
Love that all the elements in any data structure my guy here makes are so understanding and polite even in the face of certain death❤
one of the great DSA lecture on youtube..........i mean only one
Completed all the 10 ques and moving to the next video🚀🚀
Where are they
He's such an amazing teacher ...... he's a life saver...may he do good in his life
Please like the video whether you like the video or not, please like the video he is putting up a lot of effort on it..
Bhai you literally made DS & ALGO easy💌💘
your way of teaching touches skies😎
idk why but really hats off to you , after learning The first thirteen minutes of content i got so confident that i promptly went for solving LRU Cache 😂 ( though couldnt solve it , i will definitely do after watching the complete content ) but i am now confident on my Linear DS Primers !!! Thank You
@38:46 If k is out of bound adding below code after while statement would cover that scenario
if (kNode == null) {
return head; // K is larger than the length of the list
}
The k ranges from 1 to N 25:51
Great work sir, iske baad String ki playlist aa jaye toh accha rahega kyunki baaki TH-cam ne String utna deep dive kiya nhi in terms of algorithms and questions. So, if possible please bring string playlist in near future.
Thanks ❤
strings are vast , no matter how much ever we solve there can still be a question which we may not be able to do , instead ask for stack queue or heaps , greedy etc
@@codeguy21 stacks, queues or heaps are easier topic. There are 4-5 patterns on each if you understand the pattern you can solve. Also many other TH-camrs have taught these topics. But string is something that is not much touched yet and is also important in terms of interview. I myself faced string questions in 7 interviews out of 10.
@@AbhishekVerma-yw1psaverage kiitian
@@AbhishekVerma-yw1ps can you tell the patterns .
@@AbhishekVerma-yw1ps can you tell the patterns .
00:04 Doubly linked list allows traversal in both directions.
02:03 Doubly linked list stores data and points to both next and previous nodes.
06:21 Adding a new node to the doubly linked list
08:35 Creating a doubly linked list from an array
13:11 Converting array to doubly linked list
15:11 Deleting from a doubly linked list with multiple elements
19:20 Implementing delete operations on a doubly linked list.
21:17 Ensure the new tail of the linked list points to null and disconnect from the previous element.
25:21 Deleting elements from a doubly linked list
27:22 Traversing a Doubly Linked List to find the kth node
31:46 Handling deletion in Doubly LinkedList
33:55 Deleting a node in a Doubly LinkedList
37:57 Deleting a given node from a doubly linked list involves changing pointers.
40:00 Explaining how to delete a node in a Doubly LinkedList
44:06 Learning about insertion of nodes in doubly linked list.
46:19 Inserting before head and tail of a linked list
50:19 Inserting before the tail in a doubly linked list.
52:27 Inserting before the Kth node of a linked list
56:51 Inserting before a given node in a Doubly LinkedList
58:50 Understanding insertion of nodes in a doubly linked list
1:02:40 Deletion of tail using Doubly LinkedList
Crafted by Merlin AI.
Hello Striver Bhaiya , I have doubt in a specific part of the code . My doubt is in inserting a node at Kth node problem. Like I am thinking of an edge case in which if(head == NULL) && (head == NULL) which basically mean list is empty and list has only 1 element respectively right and if (K > 1) which basically mean it is telling us to insert a node at the position where node is not available right and then for that we have to return NULL . So, basically I wanted to tell my point on this case , I know you would have also tell that point but might have forgetten while teaching. By the way Thank You Bhaiya for creating this wonderful DSA playlist , it really really helped me. Hope in future I could meet you in person. Thank You Bhaiya
Thank you so much Striver for amazing series !!!! Great work👍👌
I want to point out a small mistake aside from that the tutorial is fire.
when you are deleting head make sure there is a node present when moving the pointer because you have to make the prev pointer of the next node null. This issue can occur when there is only one element present in DLL
Thanks a lot dude for adding question links in the description 👌
Your english is also very simple so I am able to understand easily
but your english is not good.
@@sahilrao4592 yes I know already 😂
@@Future_software_enginneer nice you edited 😁😆
Bro make DSA my addiction
please sir i havent found any great source for strings and facing so many problem please sir make a playlist for Strings that would be a great help
yes sir
please make a playlist for strings
striver when will you do strings part
Yaa please
lecture 3 done,love u bhaiya
Bro going to upload the whole album
great work bhaiya💌
Striver is doing extremely well
thanks for your efforts bhaiya
for deleting the kth node, suppose if DLL length is 4 and my k=8, the while loop will stop when temp is the last node, making prev as second to last node, and front will become the nullptr, that means even though k is beyond the length of linked list , we still removed the last node because front was null
Bhaiya many of the problem links in the description are not correct. Please look into that
Thanks striver for this free series
For doing deletionAtTail instead of storing back in another Node we can just do tail.back.next.
Anyone reading the comment correct me if I'm wrong.
Great explanation and superb playlist
well that is a smart way of doing it, I will trying doing it this way ❤
Instead of taking new variable prev, we can also do like,
tail.back.next = null;
tail.back=null;
right??
Thanku you bhaiya making topics so easy. :)
for the part tail deletion we can simply traverse to the last node and do temp->back->next = nullptr in cpp and can simply do it in one line and wont be making a new temporary variable to store previous
Node *DeleteTail(Node *head)
{
if (head == nullptr)
{
return nullptr;
}
// if the list has only one node
if (head->next == nullptr)
{
delete head;
return nullptr;
}
Node *temp = head;
while (temp->next != NULL)
{
temp = temp->next;
}
temp->back->next = nullptr;
temp->back = nullptr; // its not compulsary to do as we delete temp
delete temp;
return head;
}
What are the 2 problems showing below (in problem tab) when writing in c++?
Such a great heart to share knowledge!
Thanks Striver for the help all the time!!!!
@ 18:54 at line 47 what if i not write prev->next =nullptr and straight away write delete prev will the link between prev and head will be removed automatically or its necessary to remove link between prev and head manually.
Thankyou so much❤❤
Sir when will you post videos for sliding window techniques, and problems on stacks and queues ?
I think there should be a correction in deletation in the case when front ==NULL) previous should be point to null ptr prev->next=null ptr
Deletion of tail of the DL. you given this link wrong striver.can you please check and update it
46:11 the function name insertBeforeHead is misleading if we’re handling the case where head might be NULL. When head is NULL, there’s technically no "head" to insert before. Otherwise, top-notch video :)
one playlist for strings please
Understood,Thanks striver for this amazing video .
Hey Striver...We love you as always😍
great work and thank you THALA
thankyou
Hey everyone, I just have a small doubt at 22:53. Is there any need for removing the tail->back when we are deleting it anyway?
best explanation ever!🎉
hey striver, thanks for the series.
do we have to assign prev->next = nullptr? as we are eventually deleting prev itself, will the next pointer cause any problems?
just a small doubt is:
that in the question of deleting the node of a DDL at time 43:09, the node to be deleted was given as argument, so just i want to know is that do by providing the node as an argument and not traversing to get it and then putting the logic for deletion, the note gets deleted or it is because you have continued the different operations in one program
true dsa treasure
sir plz upload strings playlist
hey striver in removeKelement dont you need to have a flag to check whether the while loop is terminated when kNode==NULL or cnt becomes == k. I mean there are two conditions through which we can come out of while loop. Lets say k==5 then we come out of it when kNode becomes ==NULL and then in the next step you are writing Node* prev=knode->back, so i think here we will get error
Thank You Bhaiya....
Understood!!!
Thank you so much Striver!!!
47:00 insert before head should have condition for if(head == null)
Thankyou...Help people God will help you
striver bhai , waiting for agala lecture
Striver bhaiya u r the besssttttttttt
Done and dusted like never before.
Legend striever ❤
Deletion of head & tail aap same link dal diye hai description mai
sir please make the string playlist
If i do get a Good Job with 6lpa + ,
Its all because of you Raj Bhaiya❤
In the remove kth problem, if we will remove the first element only if k=1 and same goes for last element if k = size of LL then only we will remove it right? then why are we doing those edge cases at the start?
On the TUF site, the progress bar is not showing any progress.
Someone solve my doubt
At 17:53 in C++ , if we are deleting prev , then there is no need to write prev->next=nullptr, right? cause we are gonna delete prev anyways so there should be no need to chnage its next
same doubt
Bro you are fabulous
Striver ! I want the codes for all the problems in the video written in c++ vs code (in your notes link they are not updated)
Bhaiya apka solution coding nija pa TLE da rahe hai insertion of double linked list ka yha o/w compile error ??
Can someone please help me. Inserting before tail of doubly linked list code is not working
striver is best😍😍
What a tier 3 college 2nd year undergrad with basic of dsa and language should do for a good future please suggest as per you experiences
understood :)
Understood, thank you.
great thanks to TUF
Best 👽👽
what if front and back link with temp is not remove and we free temp ; then what will happen ?
Thank you Sir !
understood, could code by myself
why we can't insert a node before head node in DLL
Awesome ....
Understood✅🔥🔥
I understand the deletion at 17:53, However, if you don't mind me asking why exactly are we trying to do "prev -> next = NULL", will simply "delete prev" not delete the values of next and back associated with it as well?
We can ignore this "prev -> next = NULL".. then also code will work
Yes its true
@@printfiamd5254
@arshpathak1894 The reason for doing is that we don't want to waste our memory so we will pointing it to null bcoz if the node is of no use then there is no sense in pointing it to some other node
@@printfiamd5254My thoughts exactly.
@@neerkhandor5007that wasn't what I was asking, am saying there is no need to take care of dangling pointers by making them explicitly point to NULL when you are going to delete the object itself of which that pointer is an instance of.
Amazing!
best video !!!
Completed!
UNDERSTOOD;
thanks bro
14:10 deltion
thanks sir
52:44 inserting kth node pos in link list 52:45
understood❤
Understood !!
Understood 😌
Understood!
mainu naukri chahidi ae, koi mainu ashirwaad deo ke mainu naukri mil je te mai roz balle balle kara naal lassi peewa, burraahh!!