0:00 Intro 0:34 Deletion of the head of LL 6:18 Deletion of the tail of LL 15:47 Deletion of the Kth element of LL 30:14 Delete the element with value X 32:15 Insertion at the head of LL 35:15 Insertion at the tail of LL 38:41 Insertion at the Kth position 51:22 Insertion before the value X Thank You Striver for the Playlist and your hard work
@GotetiKrishnasrikar4 ай бұрын
@immortal6978 Жыл бұрын
A hell lot of hardweork for the community. Hat's off your dedication to coding. Hit like on video if Agreed.
@AnshGupta-pr7qoАй бұрын
How could someone be so perfect at explaining.....literally hats off to you striver If in life i ever had a chance to meet or see you it'll be one of mt best day
@5640_GlenaSAHA5 ай бұрын
you are the best one to teach linked list in the easiest manner, I wasted my whole third semester understanding linked list but still failed. But you are really amazing!!!!
@chrish44032 ай бұрын
So grateful , Linked list is a topic ive been avoiding to learn from my boards due to lack of understanding, but in just two videos you have made me so well versed with linked list, wish i found this video two years ago,
@vedikamishra0095 күн бұрын
same, but 2 years ago it didn't exist sadly :(
@loremvampire6343 Жыл бұрын
I was waiting for this playlist since one month. Thank you so much Sir
@ronakvaghela27143 ай бұрын
One of the best coding content on the whole youtube. You're an inspiration to everyone and a great example of how hardwork looks like. Thanyou so much for doing this. you deserve everything you wish for and hope to see such content more from you.
@ShubhraneelChakraborty-cj8zm4 ай бұрын
For insertion of a node at the head of the linked list, we can also do this: Node temp=head; head=val; head.next=temp; return head; What its doing is that, the previous head is being assigned to a temporary pointer, and the new node being inserted (val) is being assigned to the initial head pointer (head), a simple swap. Then the head's next is being assigned the temporary pointer (holding the initial head) to link the new head and the previous one. Hope that helps. And thank you Raj bhaiya for such an amazing video again, the explanation was so clear.
@GirishaMalani-fs4ch4 ай бұрын
but then what will be temp->next?
@ShubhraneelChakraborty-cj8zm3 ай бұрын
@@GirishaMalani-fs4ch Forgot to mention, it is in Java, so it will be collected by the garbage collector. For C++, you need to free that pointer.
@publicuses8589 Жыл бұрын
Striver bhaiya u r a gemmmmm lot's of respect for u 🫡🫡
@VishalGupta-xw2rp Жыл бұрын
Notes 33:33 Insert at head 50:01 Delete Nicely done
@Ranganadhamkrishnachaitanya278 ай бұрын
How code will work I'm confused
@AmanSharma-xy1qm11 ай бұрын
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.
@anuragprasad61169 ай бұрын
For deletion at k index, you can check if(cnt == k-1) and perform curr->next = curr->next->next; instead of keeping a previous pointer.
@purvamjain49533 ай бұрын
it wil give u error, assume u have 4 elements and they asked to remove 5th element. with cnt=k-1 it will try to access next element of null which will throw error unless u catch it manually
@sanjayutchula78492 ай бұрын
In order to avoid this we can maintain a int size variable in class and declare it public update every time we add or delete node and for deleting a kth node we can check at starting if it exceeds the boundaries and throw an error else we can run a for loop for k times and move the temp pointer to reach before which we want to delete @@purvamjain4953
@VivekKumar-kx2zf2 ай бұрын
@@purvamjain4953 no that can also be skipped using a if condition.. Look at this code : static Node DeleteAny(Node head, int k) { Node temp = head; if(k == 1) { head = head.next; return head; } for(int i = 1; temp != null;i++) { if(i == k-1 && temp.next!=null) { temp.next = temp.next.next; } temp = temp.next; } return head; }
@mdfaizanmdfaizan6041Ай бұрын
@@purvamjain4953we can apply for a condition before
@santhoshl-zq1op26 күн бұрын
But , at the starting itself , we check the condition if( k > lengthof LL ) return head;
@5640_GlenaSAHA5 ай бұрын
believe me on this when i say he is the best!!
@utkarshsingh092 ай бұрын
His teaching skills!!! Hats off!
@prathameshjadhav2942 Жыл бұрын
Next level teaching ❤
@hareshnayak73027 ай бұрын
Understood,Thanks striver for this amazing video.
@S3aw0lf9 ай бұрын
Superb explanation, was able to do the code by myself starting from 2nd video after understanding you explanations.
@dipingrover19703 ай бұрын
Such a hard topic explained in best way possible Thanks a lot man 😊.
@vaishnavi.pvaishnavi.p84749 ай бұрын
superb explanation sir...... i want to listen you more and more
@PCCOERCoderКүн бұрын
Lecture successfully completed on 26/11/2024 🔥🔥
@ompawar9791 Жыл бұрын
I searched for this kind of videoes from last few days. Now i got that man ->striver.........YOU CREATED ME AS A POINTER WHERE I STORED ADDRESS OF YOUR CHANNEL IN MY HEART❣❣❣❣❣❣❣❣
@ompawar9791 Жыл бұрын
wow
@pranaycc Жыл бұрын
Crisp And Detailed, 💕💕
@chetna2532 ай бұрын
a lot of hardwork ...respect bruh
@harshitgarg2820 Жыл бұрын
Completed this video and done all the 11 questions of the sheet.✅✅
@himanshukaushik922310 ай бұрын
Bro last 2 questions ma compilation error bta Raha insertion ma sheet ka
@harshitgarg282010 ай бұрын
@@himanshukaushik9223 bhai typos me error hogi, ek baar dobara check kro fir run krna, agr vs code use krr rhe ho toh mingw ko reinstall krke dekho
@himanshukaushik922310 ай бұрын
Bhai coding ninja pa last 2 question compile error bta rahe hai
@Ady-tf1jm3 ай бұрын
Best Playlist for beginners.
@prajjwalsinghrathore9458 Жыл бұрын
Thanks bhayya for the playlist, we appreciate it , it would be good if you add time-stamp to it.
@Ravithasingh089 Жыл бұрын
Glad to be the First viewer brooooo🎉🎉🎉. Thank you so much for this quality content.!!
@AtanuDebnath5 ай бұрын
Raj Dada , Love you! ❤❤❤ You make the hard things look so easy!
@GauravGupta-no7sf10 ай бұрын
00:04 Deletion and insertion in linked lists 02:21 Freeing memory in C++ and Java 06:58 To delete the last element in a linked list, the list must have at least two elements. 09:34 Deleting the tail element from a linked list 14:28 Demonstration of removing elements from a linked list in Java. 16:46 Deleting elements from a linked list 21:04 Discussing traversal and conditions for stopping 23:27 Managing deletion and insertion in a linked list 28:03 Removing elements from a linked list in Java 30:23 Deleting elements from a linked list based on given value. 34:35 Inserting before and after the head in linked list 36:44 Inserting a new node at the end of the linked list 41:06 Insertion in linked list at different positions 43:21 Traversing and manipulating temporary in linked list 48:12 Covering all the H cases for node insertion in a linked list 50:27 Inserting and deletion in linked list 54:42 Insertion before a value in a linked list
@glife549 ай бұрын
Ai
@DeepikaaSelvam3 ай бұрын
Waiting for Strings Playlist !.. No one is talking about the String Concept!!!
@MOHAMMEDMOJAHID-rg8sc3 ай бұрын
Me too
@Rohit-ht8kdАй бұрын
at 29th min the code for if(k == 1) is head = head.next; return head: but you have written Node temp = head: return head;
@lordgaming717824 күн бұрын
Thank you for the explanation
@prathamrajsrivastava980711 ай бұрын
hey striver... when's the strings playlist coming out??
@sauravkumar990011 ай бұрын
Bhaiya please make a playlist videos on Strings from basic to advance
@uchihaitachi53769 күн бұрын
Striver love you bro how can you make things very simple thank s bro❤
@AtulPal-i5s2 ай бұрын
Waiting for String Playlist
@omkarsawant92676 ай бұрын
Guys during Insertion kindly modify your node constructor or else you will get argument error. Modified code below-> class Node { public: int data; Node *next; public: Node(int data1, Node* nextNode = nullptr) { data = data1; next = nextNode; // argument added } }; Below Insert Node code--> Node* insertHead(Node* head, int val){ Node* temp = new Node(val, head); return temp; } int main() { vector arr = {2, 5, 8, 7}; Node *head = convertArr2LL(arr); head = insertHead(head, 18); print(head); return 0; }
@JalalMujawar3 ай бұрын
Code for removing a node without knowing the head: public void deleteNode(ListNode node) { node.val = node.next.val; node.next = node.next.next; }
@newbie80514 ай бұрын
0:34 ha, my initial thought was to use a slow and fast pointer, and when fast pointer approaches the node to be deleted, we skip it by having next of slow pointer be the next node
@HarishKumar-jm5bk Жыл бұрын
Striver can u please make series on binary numbers number theory and bit manipulation there is no video on youtube please make this video if possible
@sonyshaw99646 ай бұрын
Indeed supreme quality article
@SanthoshaK-px8rq5 ай бұрын
public Node DeleteK_ele(Node head, int k){ Node temp = head; if(k == 1){ temp = head.next; return temp; } int i=1; while(i
@AbhishekRanjan-wk7xp4 ай бұрын
but how will you handle the case when k>length of linked list
@ARNAVGUPTA-s1m2 ай бұрын
If we create a dummy node before head, we will not have to worry about edge cases. Just remember to return dummy->next.
@vivekkumar8419 ай бұрын
awesomee lecture bhaiya!!!
@beaware70 Жыл бұрын
Great explaination sir❤❤❤❤
@doremon810727 ай бұрын
loved it, Jai ho striver bhaiya
@Ayeshasingh7204 ай бұрын
so.... finally i m understanding LL🙂
@shivamswarnkar776326 күн бұрын
In the very last code which he has written we have to write while(temp.next.next not equal to null) instead of while temp.next not equal to null. If I am wrong, would be grateful for corrections.
@gyanendrasonkar31444 күн бұрын
I feel the condition is fine and safe to have. eg: case1) 1->null key = 1, ele= 2 if (head.val == key) return new Node(ele, head) works. 2->1->null Case 2) 1->2->null key =2, ele=3. temp =head; So , temp points to head, temp @1. (temp,head) 1 ----> 2->null if temp->next->data is same key( 2==2) , yes create a node, x = new Node(ele, temp->next) x 3---> 2---> null ^ | 1(temp,head) temp -> next = x; x 3---> 2---> null ^ | 1(temp,head) 1->3->2->null Another example::: 1-2-3-5-6-null key =5, ele 4 when we found the key, ( temp->next-data== key), stop here and add the node ^^^ head temp 1-----2-----3--------5---------6---null x = new Node(ele, temp->next) h temp x 1----2-----3 4------5----6--null ( remember temp next still pointing to 5 , can't draw ^^) temp -> next = x; h 1-2-3-4-5-6-null I hope it is cleared now...
@venkat.sairam11 ай бұрын
🎯 Key Takeaways for quick navigation: 00:03 🌐 *Introduction to the video on deletion and insertion in linked lists, covering eight different problems.* 00:30 🗑️ *Explanation of deleting the head of a linked list.* 01:25 🔄 *Moving the head to the next node as part of deletion process.* 02:49 💻 *In C++, using `free` or `delete` to remove a node; not needed in Java due to garbage collection.* 03:56 🧑💻 *Writing a function to return the new head after removing the original head.* 06:10 📌 *Detailed explanation of deleting the tail of a linked list.* 07:41 🖊️ *Writing code for deleting the tail of a linked list.* 11:35 ✂️ *Description of removing the tail by pointing the second last element to null.* 14:25 💬 *Transitioning the explanation to Java implementation.* 16:29 🔍 *Discussing deletion of a specific element in the linked list based on its position.* 19:15 👨🏫 *Explaining the code for deleting a node at a given position.* 21:42 🤔 *Consideration of edge cases in linked list manipulation.* 26:36 🖥️ *Demonstrating code for removing an element at a specific position.* 29:14 🚀 *Transitioning to Java implementation for element deletion.* 32:14 🔀 *Shifting focus to insertion in linked lists, starting with inserting at the head.* 35:12 ➕ *Discussing insertion at the end (tail) of the linked list.* 38:43 📍 *Explaining insertion at a given position in the linked list.* 42:48 📝 *Writing code for inserting a node at a specific position.* 51:04 🎯 *Discussing insertion of a node before a node with a given value.* 54:02 ✨ *Concluding with a summary of all the linked list operations covered.* Made with HARPA AI
@vivekgautam97662 ай бұрын
Make a series on strings from basics to advance.
@AnujTiwari-g8o2 ай бұрын
you are a star bro...🔥🔥🔥🔥🔥🔥
@Shikaslad-s5f3 ай бұрын
don't know what might be the issue but if k = n+1 where n = length of LL it is still removing the last element from LL Here is the code Node* removek(Node* head, int k){ if(head == NULL)return head; if(k==1){ Node* temp = head; head = head->next; delete temp; return head; } int count = 0; Node* prev = NULL; Node* temp = head; while(temp != NULL){ count++; if(count == k){ prev->next = prev->next->next; delete temp; break; } prev = temp; temp = temp->next; } return head; }
@rohitkuttum31023 ай бұрын
in delete tail remeber to free the head if (head->next==null) while using c++ . ignore java,python,js developers.
@dhikshitha7694 Жыл бұрын
Awesome video! In deletion of last/tail node in the base case if either the length is 0 or 1 we return null, but when length is 1 we should free the allocated memory that is delete head and then return nullptr right?
@saitejanedunoori54516 ай бұрын
great work and thank you THALA
@AshokKumar-td2qo10 ай бұрын
Hey Striver you are my inspiration. Very thank you for LinkedList playlist ❤❤ Please suggest dbms in english video i can't understand hindi
@ThakurIsGeek10 ай бұрын
good work i have learn alot from you
@adebisisheriff1599 ай бұрын
Thanks so much Striver!!!!
@MyAnish22 Жыл бұрын
@25:40 timestamp - we can also write prev->next = temp-> next? Also, if k==4 then tail gets deleted but what about indicating prev as the new Tail? Can understand, if any node pointing to nullptr is a tail then its fine.
@khushisaraswat58264 ай бұрын
Nice tutorials u have removed the need of such paid dsa courses....
greatttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt lecture i ever watched
@ShubhamKumar-me7py6 ай бұрын
hey can we do dsa together
@amanasrani64053 ай бұрын
Thank You so muchhhhh ❤❤❤❤❤🙏🏻, understood
@TON-10810 ай бұрын
Understood, Thanks!
@alphaCont10 ай бұрын
fantastic man
@RaviKumar-sn6tu7 ай бұрын
besst video I have seen
@anshukumari622610 ай бұрын
Thanks for the video!
@NazeerBashaShaik7 ай бұрын
Understood, thank you
@jainkokila23352 ай бұрын
55:30 found is bool it cannot store 1 it can store true to solve our purpose
@AniketKumar-hf2bo8 ай бұрын
thnx for amazing video ❤❤❤👌👌👍👍👍👍
@DevashishJose8 ай бұрын
Thank you so much.Understood
@tekashi6943Ай бұрын
Understood❤
@itsksujan6 ай бұрын
35:00 don't we have to update the head to point to the new node that is inserted at the head ?
@deadlock49196 ай бұрын
Just thank you 👍🏻
@nrted38775 ай бұрын
Thanks striver bhai
@Tbm4545Ай бұрын
32:22 insertion node
@Ergoswami7 ай бұрын
Completed!
@krishaelle83099 ай бұрын
Thank you
@yetohkardiya3 ай бұрын
🐐GOAT 🐐
@YourCodeVerse10 ай бұрын
Understood✅🔥🔥
@stutimishra57274 ай бұрын
u are gem
@supernova4467 Жыл бұрын
idk no why i cant do problem solving i can understand dsa topics pretty easily but cp feels very hard to me like this year codevita questions like orchard , vip cafe , maze runner i could not figure out them im really ashamed of myself
@VishalGupta-xw2rp Жыл бұрын
You start with A20J Ladder
@sharaneshwar1305Күн бұрын
Node *deletekele(Node *head,int k){ if(head== NULL || head->next==nullptr){ return nullptr; } int cnt=1; Node *temp=head; Node *x; if(k==1){ x=temp->next; delete temp; return x; } while(temp){ if(cnt==k-1){ x=temp->next->next; delete temp->next; temp->next=x; } temp=temp->next; cnt++; } return head; } can we use this logic for deletion raj sir
@SYCOA12CHAITANYAASOLE3 ай бұрын
Understood !!
@RoshanKumar-jf5bx Жыл бұрын
Superb
@sarthakvarshney3830 Жыл бұрын
You are great bhaiya
@bullymaguire23356 ай бұрын
is there a python playlist for linkedlist im unable to find it .