hey man , your explanations are so good and voice is quite clear as well. I see you are not making videos currently . I really hope you start it whenever possible cause these are for sure very helpful. cheers
Hi! Thanks a lot for the feedback! Yes, I've been taking a break for the last couple of months due to work commitments, but I plan on making new videos very soon! I'm currently exploring different things that I'd like to make more videos on, other than LeetCode :) Again, thanks for the support!
Got stuck on many paid Udemy courses explaining Linked lists, but you definitely nailed it! Nice visualization and explanation, also a variable names are incredibly meaningful in understanding this algorithm! Big like!
Thanks for the great insight had trouble understanding this In addition we need to add a dummy node (sentinel) to cover for scenarios where we need to reverse from the head of the linkedlist
if instead of nodeToBeExtracted->next=nodeBeforeSublist->next if we write nodeToBeExtracted->next=workingPtr why is it not working as nodeBeforeSublist->next is pointing to address of workingPtr
WorkingPtr will only be equal to nodeBeforeSublist->next for the first iteration, after that the workingPtr will be further ahead in the list with other elements between itself and nodeBeforeSublist. I hope this clears it out, otherwise look at the second iteration in the demo I give in the video, you'll see that there is another element between workingPtr and nodeBeforeSublist once the first element has been 'cut & pasted'.
Hey, I'm glad you asked. This is a common design pattern while working with linked lists in cases when you need to return a new list. The idea is that you always want dummy.next to be the head node. Think of examples when your head might be null, the dummy allows you to keep track of that node. This is also useful in cases when you need to perform some other tasks, such as rotating or reversing a list, when you need a pointer to the previous element of your current node (and your current node might be head itself). The point is, you can probably get by without using a dummy node as well, because there's always more than one way to do something. But it's a helpful pattern that you'll realise is adaptable to a lot of problems. I hope this helped!
I liked the explanation sir, but it will be better to understand if you keep the variable name a little bit shorter (without compromising the meaning) Thanks for this awesome content
Hey, if you look at the whiteboard explanation, you'll see that we never really update the workingPtr. It always points to the same node (with value 3 in our example). The only thing that changes is the next pointer of the workingPtr, which we do update in every iteration of the loop. Hope this clears it up
Whole logic sit at you dummy pointer, I tried this problem with reversing sublist then join likns properly but for 2 elements it got failed, but after seeing your video I got idea of dummy node.
Count the number of times I said "essentially" in this video :P
Loved the way you named your variables! Half the battle in understanding is won right there.
Hahaha yes I do like to keep my variable names descriptive! Thank you, and be sure to subscribe for more content!
After spending hours on this problem, i finally understood because of your explanation . Thankyou :)
Glad you understood the concept! Be sure to subscribe for more videos!
hey man , your explanations are so good and voice is quite clear as well. I see you are not making videos currently . I really hope you start it whenever possible cause these are for sure very helpful.
cheers
Hi! Thanks a lot for the feedback! Yes, I've been taking a break for the last couple of months due to work commitments, but I plan on making new videos very soon! I'm currently exploring different things that I'd like to make more videos on, other than LeetCode :)
Again, thanks for the support!
Best Explanation on the internet. Thanks a lot man!
Thanks man. Will be using variable names going forward :)
very welll explained....
Got stuck on many paid Udemy courses explaining Linked lists, but you definitely nailed it!
Nice visualization and explanation, also a variable names are incredibly meaningful in understanding this algorithm! Big like!
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null.
plz help.
Awesome explanation. Though I code in Java, your explanation was the best I could find and understood it properly. thanks
Glad I could help! Be sure to subscribe for more upcoming content! ♥
Very Nice Explanation!
Amazing explanation! The best part is the diagram you drew.
Thank you so much! I'm glad you found this useful, please consider subscribing for more content!
@@JyotinderSingh great video. What software do you use to draw and present at the same time?
What a crisp explanation.... !!! thank You :)
Just loved the variable names...It became damn easy after that to undersatnd
Glad you liked it! Be sure to subscribe for more videos!
The simplest solution I found ngl
Really helpful!
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null.
plz help.
Amazingly amazing explanation. Understood in one go :D
That's so great go hear! Please consider subscribing for more videos!
your explanation is remarkable, literally I have no words...... superb
Plzzzzz upload more videos
thank you thank you so much your explanation was the best
Excellent !! Using diagram and name of pointers you have turned this hard concept into soo easy to understand !! Thanks
These comments make my day! Please consider subscribing for more content!
I am preparing for my internship will you give some suggestions ?
Sure, feel free to email /DM me about any specific thing you wish to ask. I'll try my best to help!
My social media is linked on my profile
@@JyotinderSingh Can you provide me your LinkedIn account ?
www.linkedin.com/in/jyotinder-singh
Very nice explanation.
Thanks a lot.
Thank you!
This was a great explanation, mate!
Awesome explanation Bhai!!
Thanks for the great insight had trouble understanding this
In addition we need to add a dummy node (sentinel) to cover for scenarios where we need to reverse from the head of the linkedlist
Wonderful visualization and explanation! Thank you a lot!
Amazing Explanation Brother all there were n doubts at all.
brilliant explanation and naming variables ... thanks a lot
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null.
plz help.
you are amazing, your code is very explanatory ...
Thanks for the good video
Amazing approach! Thanks :)
Glad I could help! Be sure to subscribe for more content!
this is insightful, thanks!
Very good explanation sir
Thank you! Be sure to subscribe for more content!
amaing explaination!!!
Superb explaination.... Thanks man...
Glad I could help you understand the concept! Please consider subscribing for more videos!
Thanks for this video, made things a lot easier for me. Great Job!!
big appreciation for this !!
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null.
plz help.
awesome explanation!
Krishna bless you. Nice explanation.😊
Great explanation! Only question is, why did we have to create dummy list? Why couldn't we do it with existing list?
Damn! what an explanation !!
Glad you were able to understand the concept! Be sure to subscribe for more videos!
Fantastic explanation
Thank you! Please consider subscribing for more videos!
@@JyotinderSingh sure
Amazing 😊🤩
Thank you! Be sure to subscribe for more content!
if instead of nodeToBeExtracted->next=nodeBeforeSublist->next if we write nodeToBeExtracted->next=workingPtr why is it not working as nodeBeforeSublist->next is pointing to address of workingPtr
WorkingPtr will only be equal to nodeBeforeSublist->next for the first iteration, after that the workingPtr will be further ahead in the list with other elements between itself and nodeBeforeSublist.
I hope this clears it out, otherwise look at the second iteration in the demo I give in the video, you'll see that there is another element between workingPtr and nodeBeforeSublist once the first element has been 'cut & pasted'.
Thank you so much
Very helpful. Thanks
Thanks a lot! Be sure to subscribe for more content!
could you please explain the need of dummy pointer and its usecase?
because you can't change directly the main head of the linked list... that's why he has taken the dummy pointer...
Amazing explanation thanks a lot 😊
Glad you liked the video! Subscribe for more content!
Whats the point of the dummy pointer? Still don't understand
can't you just return head at the end?
Hey, I'm glad you asked. This is a common design pattern while working with linked lists in cases when you need to return a new list.
The idea is that you always want dummy.next to be the head node. Think of examples when your head might be null, the dummy allows you to keep track of that node. This is also useful in cases when you need to perform some other tasks, such as rotating or reversing a list, when you need a pointer to the previous element of your current node (and your current node might be head itself).
The point is, you can probably get by without using a dummy node as well, because there's always more than one way to do something. But it's a helpful pattern that you'll realise is adaptable to a lot of problems.
I hope this helped!
@@JyotinderSingh ahhh ok that makes a lot of sense. thank you. so basically for this probably you don't really need a dummy pointer.
Glad I could help! Be sure to subscribe for more content!
The dummy pointer is used to handle the case where the sublist is at the start of the list
hi, do we always need to have dummy node? I am trying without using dummy but it does not seem to work. Could you please help?
I liked the explanation sir,
but it will be better to understand if you keep the variable name a little bit shorter (without compromising the meaning)
Thanks for this awesome content
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null.
plz help.
pretty well solution :))
Thank you! Be sure to subscribe for more content!
You are gem bro :) Thanks would be such a small word for ya!
It really means a lot! Thank you!
@@JyotinderSingh My pleasure bro 😀
Thank you so much!
Can you do a video on Rotate Array,Next Permutation,Product Of array except self ?
Hey, sure. I'll try adding those :)
please someone clear this
in loop our working pointer needs to be updated na.. with just start++ how our working pointer is getting updated..
Hey, if you look at the whiteboard explanation, you'll see that we never really update the workingPtr. It always points to the same node (with value 3 in our example). The only thing that changes is the next pointer of the workingPtr, which we do update in every iteration of the loop.
Hope this clears it up
Whole logic sit at you dummy pointer, I tried this problem with reversing sublist then join likns properly but for 2 elements it got failed, but after seeing your video I got idea of dummy node.
wow
how on earth am i supposed to come up with this?!