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

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 ก.ค. 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

ความคิดเห็น • 72

  • @user-nw9ip1lo8b
    @user-nw9ip1lo8b 5 หลายเดือนก่อน +6

    best solution with an accurate explanatiion and dry run

  • @amansaxena3707
    @amansaxena3707 4 หลายเดือนก่อน +1

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

  • @najafalibalti
    @najafalibalti 20 วันที่ผ่านมา

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

  • @JyotiSharma-wb1vy
    @JyotiSharma-wb1vy 9 หลายเดือนก่อน +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  9 หลายเดือนก่อน +1

      Glad you enjoyed it.

  • @zainebahmed3498
    @zainebahmed3498 10 หลายเดือนก่อน +1

    Great explanation , the best out there for linked list

  • @dharanidaran.s9063
    @dharanidaran.s9063 5 หลายเดือนก่อน +3

    crystal clear man

  • @salimmia6132
    @salimmia6132 6 หลายเดือนก่อน +2

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

  • @sangeethakumari
    @sangeethakumari 7 หลายเดือนก่อน +1

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

    • @nikoo28
      @nikoo28  6 หลายเดือนก่อน +2

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

  • @johnsnow5337
    @johnsnow5337 3 หลายเดือนก่อน +1

    Well done man, I got it clearly!

  • @SaadKhan-sg4wh
    @SaadKhan-sg4wh 18 วันที่ผ่านมา

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

    • @nikoo28
      @nikoo28  14 วันที่ผ่านมา

      Awesome! Thank you!

  • @JigarKayastha
    @JigarKayastha 3 วันที่ผ่านมา

    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 !

  • @krishnaindani8414
    @krishnaindani8414 3 หลายเดือนก่อน +1

    This is amazing breakdown

  • @bhargavinaik8145
    @bhargavinaik8145 3 หลายเดือนก่อน

    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.

  • @Slow_learner33
    @Slow_learner33 10 หลายเดือนก่อน +1

    Nice Explanation Sir

  • @raghavachekuri7270
    @raghavachekuri7270 10 หลายเดือนก่อน

    Amazing explanation

  • @nandithass7326
    @nandithass7326 5 หลายเดือนก่อน +2

    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 😄

  • @keerthanaaduri
    @keerthanaaduri 7 หลายเดือนก่อน

    hey the explanation was too good!!

  • @TheSachinAlam
    @TheSachinAlam 10 หลายเดือนก่อน +3

    Thank you sir

  • @riyarb559
    @riyarb559 14 วันที่ผ่านมา

    awesome solution buddy!!

  • @this_is_me542
    @this_is_me542 9 หลายเดือนก่อน

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

    • @nikoo28
      @nikoo28  9 หลายเดือนก่อน +1

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

  • @raiyanaulindo7004
    @raiyanaulindo7004 2 หลายเดือนก่อน +1

    excellent solution

  • @sysybaba420
    @sysybaba420 10 หลายเดือนก่อน

    great explanation, keep them coming!

    • @nikoo28
      @nikoo28  9 หลายเดือนก่อน

      More to come!

  • @sivan2878
    @sivan2878 7 หลายเดือนก่อน +1

    Awesome bro.

  • @tushar404
    @tushar404 หลายเดือนก่อน

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

  • @jaydeepvasoya6243
    @jaydeepvasoya6243 5 หลายเดือนก่อน +1

    Its awesome...!

  • @jcgan521
    @jcgan521 หลายเดือนก่อน

    Best explanation ever

  • @aarishfakih741
    @aarishfakih741 10 หลายเดือนก่อน

    Thanks a lot!!

  • @sonal123ism
    @sonal123ism 6 หลายเดือนก่อน

    wow great explanation. 👍

  • @manus7342
    @manus7342 9 หลายเดือนก่อน

    Thank you so much :)

  • @ahmedashraf3199
    @ahmedashraf3199 10 หลายเดือนก่อน

    you are the best

  • @subee128
    @subee128 6 หลายเดือนก่อน +1

    Thanks

  • @komeshsiva
    @komeshsiva 7 หลายเดือนก่อน

    Woow , soo beautiful explanation !❤

    • @nikoo28
      @nikoo28  7 หลายเดือนก่อน

      GoodNotes 6

  • @kumarineha4259
    @kumarineha4259 5 หลายเดือนก่อน

    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 9 หลายเดือนก่อน

    thank you sir

  • @arnetto8505
    @arnetto8505 10 หลายเดือนก่อน +1

    Very nice explanation

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      Keep watching

  • @plutomessi21
    @plutomessi21 10 หลายเดือนก่อน

    Thankyou for your valuable videos and time😇

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      So nice of you

  • @chakravarthybatna1589
    @chakravarthybatna1589 10 หลายเดือนก่อน

    great explanation bro

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      Glad it helped

  • @DilipKumar-si4ww
    @DilipKumar-si4ww 10 หลายเดือนก่อน

    Best Explanation

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน

      Thanks for liking

  • @parthanuj8611
    @parthanuj8611 10 หลายเดือนก่อน

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

  • @pranavbedi3898
    @pranavbedi3898 5 หลายเดือนก่อน +2

    Great explanation 🎉

  • @user-le3dq7lr4b
    @user-le3dq7lr4b 4 หลายเดือนก่อน +1

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

    • @nikoo28
      @nikoo28  4 หลายเดือนก่อน +1

      adding it to my pipeline.

  • @miguelangelcanogiraldo8015
    @miguelangelcanogiraldo8015 5 หลายเดือนก่อน

    GOD

  • @kidoo1567
    @kidoo1567 10 หลายเดือนก่อน

    😊😊😊😊

  • @zealrodrigues8495
    @zealrodrigues8495 10 หลายเดือนก่อน +2

    correction:--> Leetcode sum no. 92

    • @zealrodrigues8495
      @zealrodrigues8495 10 หลายเดือนก่อน +3

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

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน +3

      Thanks..fixed it

    • @nikoo28
      @nikoo28  10 หลายเดือนก่อน +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 10 หลายเดือนก่อน

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

  • @manyaaaa2607
    @manyaaaa2607 4 หลายเดือนก่อน

    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 5 หลายเดือนก่อน

    better than kunal kushwaha

  • @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 6 หลายเดือนก่อน

      @@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 5 หลายเดือนก่อน +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  5 หลายเดือนก่อน

      Glad you liked it!