Reverse Sublist in Linked List | (Reverse Linked List II on LeetCode) Explanation

  Рет қаралды 19,602

Jyotinder Singh

Jyotinder Singh

Күн бұрын

Пікірлер: 97
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Count the number of times I said "essentially" in this video :P
@staffeng
@staffeng 3 жыл бұрын
Loved the way you named your variables! Half the battle in understanding is won right there.
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Hahaha yes I do like to keep my variable names descriptive! Thank you, and be sure to subscribe for more content!
@engineeringflix
@engineeringflix 6 ай бұрын
very welll explained....
@yashsaini3331
@yashsaini3331 2 жыл бұрын
Best Explanation on the internet. Thanks a lot man!
@susmitapatro8720
@susmitapatro8720 3 жыл бұрын
After spending hours on this problem, i finally understood because of your explanation . Thankyou :)
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Glad you understood the concept! Be sure to subscribe for more videos!
@pythonenthusiast9292
@pythonenthusiast9292 3 жыл бұрын
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
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
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!
@rajeshkilladi7124
@rajeshkilladi7124 27 күн бұрын
Thank you so much for the explanation❤, simply get the whole concept within the first 5 min, for those guys who are checking the comments whether to watch this video is simple, go for it.
@MayankLC93
@MayankLC93 2 жыл бұрын
What a crisp explanation.... !!! thank You :)
@EmiNBega
@EmiNBega Жыл бұрын
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!
@itsninja709
@itsninja709 Жыл бұрын
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null. plz help.
@indranilthakur3605
@indranilthakur3605 4 жыл бұрын
Awesome explanation. Though I code in Java, your explanation was the best I could find and understood it properly. thanks
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Glad I could help! Be sure to subscribe for more upcoming content! ♥
@radhikadube7360
@radhikadube7360 Жыл бұрын
your explanation is remarkable, literally I have no words...... superb Plzzzzz upload more videos
@saranyavivekanandan9044
@saranyavivekanandan9044 3 жыл бұрын
Amazing explanation! The best part is the diagram you drew.
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Thank you so much! I'm glad you found this useful, please consider subscribing for more content!
@samolusola
@samolusola 2 жыл бұрын
@@JyotinderSingh great video. What software do you use to draw and present at the same time?
@itsninja709
@itsninja709 Жыл бұрын
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null. plz help.
@govindmall4731
@govindmall4731 Жыл бұрын
you are amazing, your code is very explanatory ...
@dwivedishashank9
@dwivedishashank9 5 ай бұрын
Thanks man. Will be using variable names going forward :)
@alkadas4094
@alkadas4094 3 жыл бұрын
Just loved the variable names...It became damn easy after that to undersatnd
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Glad you liked it! Be sure to subscribe for more videos!
@danielnzuma9070
@danielnzuma9070 Жыл бұрын
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
@adityachauhan1182
@adityachauhan1182 3 жыл бұрын
Excellent !! Using diagram and name of pointers you have turned this hard concept into soo easy to understand !! Thanks
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
These comments make my day! Please consider subscribing for more content!
@adityachauhan1182
@adityachauhan1182 3 жыл бұрын
I am preparing for my internship will you give some suggestions ?
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
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
@adityachauhan1182
@adityachauhan1182 3 жыл бұрын
@@JyotinderSingh Can you provide me your LinkedIn account ?
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
www.linkedin.com/in/jyotinder-singh
@shoaibhossain4545
@shoaibhossain4545 Жыл бұрын
Thanks for this video, made things a lot easier for me. Great Job!!
@ankitpaudel8901
@ankitpaudel8901 3 жыл бұрын
Amazing Explanation Brother all there were n doubts at all.
@ismailhassaballa6948
@ismailhassaballa6948 2 жыл бұрын
Wonderful visualization and explanation! Thank you a lot!
@cantseeme101
@cantseeme101 11 ай бұрын
This was a great explanation, mate!
@shrutipriya4848
@shrutipriya4848 Жыл бұрын
thank you thank you so much your explanation was the best
@RituJain-qu6sf
@RituJain-qu6sf 3 жыл бұрын
Amazingly amazing explanation. Understood in one go :D
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
That's so great go hear! Please consider subscribing for more videos!
@Ankit.yt_885
@Ankit.yt_885 2 жыл бұрын
Very Nice Explanation!
@giorgikhachidze64
@giorgikhachidze64 11 ай бұрын
Great explanation! Only question is, why did we have to create dummy list? Why couldn't we do it with existing list?
@rajendrabrahmbhatt2585
@rajendrabrahmbhatt2585 Жыл бұрын
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?
@furryna482
@furryna482 Жыл бұрын
The simplest solution I found ngl Really helpful!
@itsninja709
@itsninja709 Жыл бұрын
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null. plz help.
@hardikmittal4746
@hardikmittal4746 4 жыл бұрын
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
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
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'.
@047gauravkumartiwari5
@047gauravkumartiwari5 2 жыл бұрын
Very nice explanation. Thanks a lot.
@JyotinderSingh
@JyotinderSingh 2 жыл бұрын
Thank you!
@penchaldas7253
@penchaldas7253 2 жыл бұрын
awesome explanation!
@akshitvashishth5481
@akshitvashishth5481 4 жыл бұрын
Amazing approach! Thanks :)
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Glad I could help! Be sure to subscribe for more content!
@vinothiniseenivasan1502
@vinothiniseenivasan1502 Жыл бұрын
brilliant explanation and naming variables ... thanks a lot
@itsninja709
@itsninja709 Жыл бұрын
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null. plz help.
@pateladarsh1463
@pateladarsh1463 2 жыл бұрын
big appreciation for this !!
@michaelphan7477
@michaelphan7477 4 жыл бұрын
Whats the point of the dummy pointer? Still don't understand
@michaelphan7477
@michaelphan7477 4 жыл бұрын
can't you just return head at the end?
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
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!
@michaelphan7477
@michaelphan7477 4 жыл бұрын
@@JyotinderSingh ahhh ok that makes a lot of sense. thank you. so basically for this probably you don't really need a dummy pointer.
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Glad I could help! Be sure to subscribe for more content!
@briangorman3511
@briangorman3511 3 жыл бұрын
The dummy pointer is used to handle the case where the sublist is at the start of the list
@AbhinavKumar-dr4ef
@AbhinavKumar-dr4ef 3 жыл бұрын
Krishna bless you. Nice explanation.😊
@Abhishek-ie4mm
@Abhishek-ie4mm 3 жыл бұрын
Superb explaination.... Thanks man...
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Glad I could help you understand the concept! Please consider subscribing for more videos!
@ujjawalgupta23
@ujjawalgupta23 2 жыл бұрын
Awesome explanation Bhai!!
@saharshithasa
@saharshithasa 3 жыл бұрын
Fantastic explanation
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Thank you! Please consider subscribing for more videos!
@saharshithasa
@saharshithasa 3 жыл бұрын
@@JyotinderSingh sure
@manjotkaur6731
@manjotkaur6731 4 жыл бұрын
Very good explanation sir
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Thank you! Be sure to subscribe for more content!
@bittudwivedi6536
@bittudwivedi6536 2 жыл бұрын
Thanks for the good video
@piyushmanaswi7470
@piyushmanaswi7470 3 жыл бұрын
could you please explain the need of dummy pointer and its usecase?
@govindmall4731
@govindmall4731 Жыл бұрын
because you can't change directly the main head of the linked list... that's why he has taken the dummy pointer...
@keshavgaur4535
@keshavgaur4535 3 жыл бұрын
Thank you so much
@barnabasbabatunde5454
@barnabasbabatunde5454 3 жыл бұрын
Very helpful. Thanks
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Thanks a lot! Be sure to subscribe for more content!
@savagebeaztpeace8390
@savagebeaztpeace8390 Жыл бұрын
this is insightful, thanks!
@AvikNayak_
@AvikNayak_ 3 жыл бұрын
Damn! what an explanation !!
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Glad you were able to understand the concept! Be sure to subscribe for more videos!
@diksharajput4638
@diksharajput4638 3 жыл бұрын
Amazing explanation thanks a lot 😊
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Glad you liked the video! Subscribe for more content!
@ishaanshrikantkulkarni4660
@ishaanshrikantkulkarni4660 3 жыл бұрын
amaing explaination!!!
@ManojDohale-q6o
@ManojDohale-q6o Жыл бұрын
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
@itsninja709
@itsninja709 Жыл бұрын
its showing null pointer exception for this line at 15:58 as nodetobeextracted is null. plz help.
@100_bindusai8
@100_bindusai8 4 жыл бұрын
Amazing 😊🤩
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Thank you! Be sure to subscribe for more content!
@ayushvats1808
@ayushvats1808 3 жыл бұрын
please someone clear this in loop our working pointer needs to be updated na.. with just start++ how our working pointer is getting updated..
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
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
@AvikNayak_
@AvikNayak_ 3 жыл бұрын
Can you do a video on Rotate Array,Next Permutation,Product Of array except self ?
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
Hey, sure. I'll try adding those :)
@anikkhan8811
@anikkhan8811 3 жыл бұрын
You are gem bro :) Thanks would be such a small word for ya!
@JyotinderSingh
@JyotinderSingh 3 жыл бұрын
It really means a lot! Thank you!
@anikkhan8811
@anikkhan8811 3 жыл бұрын
@@JyotinderSingh My pleasure bro 😀
@techenthusiast127
@techenthusiast127 3 жыл бұрын
Thank you so much!
@muditkumarsingh7627
@muditkumarsingh7627 4 жыл бұрын
pretty well solution :))
@JyotinderSingh
@JyotinderSingh 4 жыл бұрын
Thank you! Be sure to subscribe for more content!
@GauravSharma-wb9se
@GauravSharma-wb9se 2 жыл бұрын
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.
@ishaankulkarni49
@ishaankulkarni49 3 жыл бұрын
how on earth am i supposed to come up with this?!
@shouryagupta8763
@shouryagupta8763 3 жыл бұрын
wow
Reverse Linked List II - Leetcode 92 - Python
16:03
NeetCode
Рет қаралды 82 М.
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 32 МЛН
Крутой фокус + секрет! #shorts
00:10
Роман Magic
Рет қаралды 40 МЛН
Don't look down on anyone#devil  #lilith  #funny  #shorts
00:12
Devil Lilith
Рет қаралды 46 МЛН
I Solved 100 LeetCode Problems
13:11
Green Code
Рет қаралды 109 М.
Reverse a Linked List | Iterative
7:32
take U forward
Рет қаралды 330 М.
LeetCode was HARD until I Learned these 15 Patterns
13:00
Ashish Pratap Singh
Рет қаралды 457 М.
LeetCode 92 | Reverse Linked List II
8:05
leetuition
Рет қаралды 11 М.
Add Binary (LeetCode) | Adding Binary Numbers as Strings Explained
12:43
How I Got Good at Coding Interviews
6:29
NeetCode
Рет қаралды 1,7 МЛН
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 175 М.
you will never ask about pointers again after watching this video
8:03
didn't manage to catch the ball #tiktok
00:19
Анастасия Тарасова
Рет қаралды 32 МЛН