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

Sdílet
Vložit
  • čas přidán 23. 07. 2024
  • 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

Komentáře • 72

  • @user-nw9ip1lo8b
    @user-nw9ip1lo8b Před 5 měsíci +6

    best solution with an accurate explanatiion and dry run

  • @amansaxena3707
    @amansaxena3707 Před 5 měsíci +1

    Surprised to see the content like this on CZcams. Great work men, Waiting for more

  • @JigarKayastha
    @JigarKayastha Před 12 dny

    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 !

  • @JyotiSharma-wb1vy
    @JyotiSharma-wb1vy Před 10 měsíci +1

    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  Před 9 měsíci +1

      Glad you enjoyed it.

  • @najafalibalti
    @najafalibalti Před 28 dny

    I can't Explain my Words. You're a perfect mentor

  • @sangeethakumari
    @sangeethakumari Před 7 měsíci +1

    Appreciated. I was always confused why most of the linked list solutions had the dummy node concept. Thanks for the clarification.

    • @nikoo28
      @nikoo28  Před 7 měsíci +2

      Yea..the dummy node is a wonderful trick. I love it!!!

  • @zainebahmed3498
    @zainebahmed3498 Před 10 měsíci +1

    Great explanation , the best out there for linked list

  • @salimmia6132
    @salimmia6132 Před 6 měsíci +2

    thank you so much brother for your nice explanation. I understand better

  • @johnsnow5337
    @johnsnow5337 Před 3 měsíci +1

    Well done man, I got it clearly!

  • @SaadKhan-sg4wh
    @SaadKhan-sg4wh Před 27 dny

    First video that im watching on your channel and the approach was so good that I had to subscribe!

  • @dharanidaran.s9063
    @dharanidaran.s9063 Před 5 měsíci +3

    crystal clear man

  • @riyarb559
    @riyarb559 Před 23 dny

    awesome solution buddy!!

  • @krishnaindani8414
    @krishnaindani8414 Před 3 měsíci +1

    This is amazing breakdown

  • @bhargavinaik8145
    @bhargavinaik8145 Před 4 měsíci

    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.

  • @sysybaba420
    @sysybaba420 Před 10 měsíci

    great explanation, keep them coming!

  • @tushar404
    @tushar404 Před 2 měsíci

    The peace with which evey🥰🥰thing just happened , amazinggg man just brilliant!!!

  • @keerthanaaduri
    @keerthanaaduri Před 8 měsíci

    hey the explanation was too good!!

  • @jcgan521
    @jcgan521 Před měsícem

    Best explanation ever

  • @raiyanaulindo7004
    @raiyanaulindo7004 Před 2 měsíci +1

    excellent solution

  • @nandithass7326
    @nandithass7326 Před 6 měsíci +2

    best solution i have come across so far after watching n videos from other channels .. pls post more!!!!!!!!

    • @nikoo28
      @nikoo28  Před 5 měsíci

      a new video every week 😄

  • @this_is_me542
    @this_is_me542 Před 10 měsíci

    Thank u so much. I really like the way you explain things from brute force solution to efficient one

    • @nikoo28
      @nikoo28  Před 9 měsíci +1

      that is how you should approach a problem in an actual interview too

  • @Slow_learner33
    @Slow_learner33 Před 11 měsíci +1

    Nice Explanation Sir

  • @raghavachekuri7270
    @raghavachekuri7270 Před 10 měsíci

    Amazing explanation

  • @TheSachinAlam
    @TheSachinAlam Před 11 měsíci +3

    Thank you sir

  • @sivan2878
    @sivan2878 Před 7 měsíci +1

    Awesome bro.

  • @sonal123ism
    @sonal123ism Před 6 měsíci

    wow great explanation. 👍

  • @komeshsiva
    @komeshsiva Před 8 měsíci

    Woow , soo beautiful explanation !❤

  • @subee128
    @subee128 Před 6 měsíci +1

    Thanks

  • @manus7342
    @manus7342 Před 9 měsíci

    Thank you so much :)

  • @aarishfakih741
    @aarishfakih741 Před 11 měsíci

    Thanks a lot!!

  • @jaydeepvasoya6243
    @jaydeepvasoya6243 Před 5 měsíci +1

    Its awesome...!

  • @kumarineha4259
    @kumarineha4259 Před 6 měsíci

    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  Před 5 měsíci

      i try to make diagrams, which can help you to remember the solutions. :)

  • @ahmedashraf3199
    @ahmedashraf3199 Před 10 měsíci

    you are the best

  • @plutomessi21
    @plutomessi21 Před 11 měsíci

    Thankyou for your valuable videos and time😇

  • @rohitchand3853
    @rohitchand3853 Před 10 měsíci

    thank you sir

  • @chakravarthybatna1589
    @chakravarthybatna1589 Před 10 měsíci

    great explanation bro

  • @arnetto8505
    @arnetto8505 Před 11 měsíci +1

    Very nice explanation

  • @parthanuj8611
    @parthanuj8611 Před 10 měsíci

    i watch your videos to hear your voice . BC its grt

  • @DilipKumar-si4ww
    @DilipKumar-si4ww Před 10 měsíci

    Best Explanation

    • @nikoo28
      @nikoo28  Před 10 měsíci

      Thanks for liking

  • @pranavbedi3898
    @pranavbedi3898 Před 5 měsíci +2

    Great explanation 🎉

  • @user-le3dq7lr4b
    @user-le3dq7lr4b Před 5 měsíci +1

    Bhaiya, we need a video for Leetcode Problem 25 - Reverse Linked List in k Groups.

    • @nikoo28
      @nikoo28  Před 4 měsíci +1

      adding it to my pipeline.

  • @miguelangelcanogiraldo8015
    @miguelangelcanogiraldo8015 Před 5 měsíci

    GOD

  • @manyaaaa2607
    @manyaaaa2607 Před 5 měsíci

    Can you please tell why we return dummy.next and not return head?

    • @nikoo28
      @nikoo28  Před 4 měsíci

      dummy.next points to head. keeping a dummy node helps you in a lot of ways. You can discard it later.

  • @kidoo1567
    @kidoo1567 Před 10 měsíci

    😊😊😊😊

  • @juishinde9809
    @juishinde9809 Před 6 měsíci

    better than kunal kushwaha

  • @zealrodrigues8495
    @zealrodrigues8495 Před 11 měsíci +2

    correction:--> Leetcode sum no. 92

    • @zealrodrigues8495
      @zealrodrigues8495 Před 11 měsíci +3

      sir can u post atleast 1 video everyday, your solutions help us a lot

    • @nikoo28
      @nikoo28  Před 11 měsíci +3

      Thanks..fixed it

    • @nikoo28
      @nikoo28  Před 11 měsíci +8

      @@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 Před 11 měsíci

      You are the best, sir...@@nikoo28

  • @hiteshbhatnagar1624
    @hiteshbhatnagar1624 Před 3 měsíci

    Yaar Nick White (Angrez) ki Copy maar rakhi hai. So sad. It humiliates me.

    • @nikoo28
      @nikoo28  Před 3 měsíci

      Sorry to hear that…What part do you feel was copied?

  • @christokawuma6962
    @christokawuma6962 Před 7 měsíci

    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  Před 7 měsíci

      Did you go through the explanation of the concept? Or went straight to the code?

    • @christokawuma6962
      @christokawuma6962 Před 7 měsíci

      @@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 Před 5 měsíci +1

    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  Před 5 měsíci

      Glad you liked it!