Reverse Linked List 2 (LeetCode 92) | Full simplified solution | Animations and Demo

  Рет қаралды 18,465

Nikhil Lohia

Nikhil Lohia

Күн бұрын

Actual problem on LeetCode: leetcode.com/problems/reverse...
Chapters:
00:00 - Intro
00:52 - Problem statement and description
02:15 - Recap: Reverse a linked list
06:34 - Efficient Solution
13:02 - Use of a dummy node
15:11 - Dry-run of Code
18:14 - Final Thoughts
📚 Links to topics I talk about in the video:
Reverse a Linked List: • HackerRank - Reverse L...
Other Problems on LeetCode: • Leetcode Solutions
Other Medium Difficulty Problems: • Medium Problems
📘 A text based explanation is available at: studyalgorithms.com
Code on Github: github.com/nikoo28/java-solut...
Test-cases on Github: github.com/nikoo28/java-solut...
📖 Reference Books:
Starting Learn to Code: amzn.to/36pU0JO
Favorite book to understand algorithms: amzn.to/39w3YLS
Favorite book for data structures: amzn.to/3oAVBTk
Get started for interview preparation: amzn.to/39ysbkJ
🔗 To see more videos like this, you can show your support on: www.buymeacoffee.com/studyalg...
🎥 My Recording Gear:
Recording Light: amzn.to/3pAqh8O
Microphone: amzn.to/2MCX7qU
Recording Camera: amzn.to/3alg9Ky
Tablet to sketch and draw: amzn.to/3pM6Bi4
Surface Pen: amzn.to/3pv6tTs
Laptop to edit videos: amzn.to/2LYpMqn
💻 Get Social 💻
Follow on Facebook at: / studyalgos
Subscribe to RSS feeds: studyalgorithms.com/feed/
Join fan mail: eepurl.com/g9Dadv
#leetcode #programming #interview

Пікірлер: 73
@user-nw9ip1lo8b
@user-nw9ip1lo8b 6 ай бұрын
best solution with an accurate explanatiion and dry run
@amansaxena3707
@amansaxena3707 5 ай бұрын
Surprised to see the content like this on KZfaq. Great work men, Waiting for more
@malishagavali9225
@malishagavali9225 Күн бұрын
Subscribed! never gonna have problems reversing LL now
@najafalibalti
@najafalibalti Ай бұрын
I can't Explain my Words. You're a perfect mentor
@zainebahmed3498
@zainebahmed3498 11 ай бұрын
Great explanation , the best out there for linked list
@JigarKayastha
@JigarKayastha 21 күн бұрын
bhai i wish your hard work will pay you off in anyways, thankyou so much ! how small details in video editing you have focused, really impressed !
@johnsnow5337
@johnsnow5337 3 ай бұрын
Well done man, I got it clearly!
@JyotiSharma-wb1vy
@JyotiSharma-wb1vy 10 ай бұрын
Wow, this explanation really made a difference! The step-by-step breakdown and clarity in the explanation were incredible. Keep up the great work!
@nikoo28
@nikoo28 9 ай бұрын
Glad you enjoyed it.
@dharanidaran.s9063
@dharanidaran.s9063 6 ай бұрын
crystal clear man
@salimmia6132
@salimmia6132 7 ай бұрын
thank you so much brother for your nice explanation. I understand better
@SaadKhan-sg4wh
@SaadKhan-sg4wh Ай бұрын
First video that im watching on your channel and the approach was so good that I had to subscribe!
@nikoo28
@nikoo28 Ай бұрын
Awesome! Thank you!
@krishnaindani8414
@krishnaindani8414 3 ай бұрын
This is amazing breakdown
@riyarb559
@riyarb559 Ай бұрын
awesome solution buddy!!
@sangeethakumari
@sangeethakumari 8 ай бұрын
Appreciated. I was always confused why most of the linked list solutions had the dummy node concept. Thanks for the clarification.
@nikoo28
@nikoo28 7 ай бұрын
Yea..the dummy node is a wonderful trick. I love it!!!
@bhargavinaik8145
@bhargavinaik8145 4 ай бұрын
Thank you so much, this was a tricky one, I tried to do it before just using the reversal technique but I was missing the key points of storing these pointer values, watched couple of videos for better logic, those were so complicated could not understand or implement even after watching it many times, was so frustrated. Just for fresh start looked at your video with 0 expectation... and wohh your explanation cleared all my doubts that I dint even know I had, which was actually stopping me from implementing the working code.
@jcgan521
@jcgan521 Ай бұрын
Best explanation ever
@keerthanaaduri
@keerthanaaduri 8 ай бұрын
hey the explanation was too good!!
@raghavachekuri7270
@raghavachekuri7270 10 ай бұрын
Amazing explanation
@this_is_me542
@this_is_me542 10 ай бұрын
Thank u so much. I really like the way you explain things from brute force solution to efficient one
@nikoo28
@nikoo28 9 ай бұрын
that is how you should approach a problem in an actual interview too
@nandithass7326
@nandithass7326 6 ай бұрын
best solution i have come across so far after watching n videos from other channels .. pls post more!!!!!!!!
@nikoo28
@nikoo28 5 ай бұрын
a new video every week 😄
@tushar404
@tushar404 2 ай бұрын
The peace with which evey🥰🥰thing just happened , amazinggg man just brilliant!!!
@sysybaba420
@sysybaba420 10 ай бұрын
great explanation, keep them coming!
@nikoo28
@nikoo28 9 ай бұрын
More to come!
@Slow_learner33
@Slow_learner33 11 ай бұрын
Nice Explanation Sir
@TheSachinAlam
@TheSachinAlam 11 ай бұрын
Thank you sir
@raiyanaulindo7004
@raiyanaulindo7004 2 ай бұрын
excellent solution
@sivan2878
@sivan2878 7 ай бұрын
Awesome bro.
@manus7342
@manus7342 10 ай бұрын
Thank you so much :)
@aarishfakih741
@aarishfakih741 11 ай бұрын
Thanks a lot!!
@ahmedashraf3199
@ahmedashraf3199 11 ай бұрын
you are the best
@sonal123ism
@sonal123ism 7 ай бұрын
wow great explanation. 👍
@jaydeepvasoya6243
@jaydeepvasoya6243 6 ай бұрын
Its awesome...!
@komeshsiva
@komeshsiva 8 ай бұрын
Woow , soo beautiful explanation !❤
@nikoo28
@nikoo28 7 ай бұрын
GoodNotes 6
@subee128
@subee128 7 ай бұрын
Thanks
@plutomessi21
@plutomessi21 11 ай бұрын
Thankyou for your valuable videos and time😇
@nikoo28
@nikoo28 10 ай бұрын
So nice of you
@kumarineha4259
@kumarineha4259 6 ай бұрын
Your explanation mechanism is the best Nikhil, I tried uderstanding this code from many platforms but it realy didnt work, appreciate your time and effort you give to explain every small bit .Thanks for explaining this question efficiently.
@nikoo28
@nikoo28 5 ай бұрын
i try to make diagrams, which can help you to remember the solutions. :)
@rohitchand3853
@rohitchand3853 10 ай бұрын
thank you sir
@arnetto8505
@arnetto8505 11 ай бұрын
Very nice explanation
@nikoo28
@nikoo28 10 ай бұрын
Keep watching
@chakravarthybatna1589
@chakravarthybatna1589 11 ай бұрын
great explanation bro
@nikoo28
@nikoo28 10 ай бұрын
Glad it helped
@DilipKumar-si4ww
@DilipKumar-si4ww 11 ай бұрын
Best Explanation
@nikoo28
@nikoo28 10 ай бұрын
Thanks for liking
@parthanuj8611
@parthanuj8611 11 ай бұрын
i watch your videos to hear your voice . BC its grt
@pranavbedi3898
@pranavbedi3898 6 ай бұрын
Great explanation 🎉
@user-le3dq7lr4b
@user-le3dq7lr4b 5 ай бұрын
Bhaiya, we need a video for Leetcode Problem 25 - Reverse Linked List in k Groups.
@nikoo28
@nikoo28 4 ай бұрын
adding it to my pipeline.
@miguelangelcanogiraldo8015
@miguelangelcanogiraldo8015 5 ай бұрын
GOD
@kidoo1567
@kidoo1567 10 ай бұрын
😊😊😊😊
@manyaaaa2607
@manyaaaa2607 5 ай бұрын
Can you please tell why we return dummy.next and not return head?
@nikoo28
@nikoo28 4 ай бұрын
dummy.next points to head. keeping a dummy node helps you in a lot of ways. You can discard it later.
@juishinde9809
@juishinde9809 6 ай бұрын
better than kunal kushwaha
@zealrodrigues8495
@zealrodrigues8495 11 ай бұрын
correction:--> Leetcode sum no. 92
@zealrodrigues8495
@zealrodrigues8495 11 ай бұрын
sir can u post atleast 1 video everyday, your solutions help us a lot
@nikoo28
@nikoo28 11 ай бұрын
Thanks..fixed it
@nikoo28
@nikoo28 11 ай бұрын
@@zealrodrigues8495 i wish I could 😅, but each video takes me a total of 10 hours from scratch to final publishing. I try to ensure 4k videos, perfect audio and quality animations. I appreciate you being patient, and I will try to cover all the important topics/questions. Thanks for watching my videos. However, if you want priority reply to comments/questions, explore my membership options as well :)
@TheSachinAlam
@TheSachinAlam 11 ай бұрын
You are the best, sir...@@nikoo28
@hiteshbhatnagar1624
@hiteshbhatnagar1624 3 ай бұрын
Yaar Nick White (Angrez) ki Copy maar rakhi hai. So sad. It humiliates me.
@nikoo28
@nikoo28 3 ай бұрын
Sorry to hear that…What part do you feel was copied?
@christokawuma6962
@christokawuma6962 7 ай бұрын
quick question on(16:10) what was the purpose of that forloop, lost me on the part of Assigning {leftPre = leftPre.next} and also{currNode =currNode.next} will appreciate your clarification on that area
@nikoo28
@nikoo28 7 ай бұрын
Did you go through the explanation of the concept? Or went straight to the code?
@christokawuma6962
@christokawuma6962 7 ай бұрын
@@nikoo28 I actually forgot to tell you that I got the concept of it…. I guess I was tired at the time of watching but when I re watched I got we had to iterate through the loop so at to get the right and left initial positions.. thank you once again for taking the initiative to respond back ​​⁠
@KomalVerma-oo5nx
@KomalVerma-oo5nx 6 ай бұрын
Wow, this explanation really made a difference! The step-by-step breakdown and clarity in the explanation were incredible. Keep up the great work!
@nikoo28
@nikoo28 5 ай бұрын
Glad you liked it!
Gym belt !! 😂😂  @kauermotta
00:10
Tibo InShape
Рет қаралды 17 МЛН
A little girl was shy at her first ballet lesson #shorts
00:35
Fabiosa Animated
Рет қаралды 15 МЛН
КАК ДУМАЕТЕ КТО ВЫЙГРАЕТ😂
00:29
МЯТНАЯ ФАНТА
Рет қаралды 10 МЛН
LeetCode Reverse Linked List II Solution Explained - Java
8:34
Nick White
Рет қаралды 35 М.
Water powered timers hidden in public restrooms
13:12
Steve Mould
Рет қаралды 668 М.
Reverse a Single Linked List
11:57
Neso Academy
Рет қаралды 250 М.
Gym belt !! 😂😂  @kauermotta
00:10
Tibo InShape
Рет қаралды 17 МЛН