LeetCode 21: Merge Two Sorted Lists RECURSIVELY - Interview Prep Ep 62

แชร์
ฝัง
  • เผยแพร่เมื่อ 25 พ.ย. 2024

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

  • @bigbigdog
    @bigbigdog 4 ปีที่แล้ว +18

    Beautiful. When I do it i always worry about the original parameter being erase so I always create a new separate return valuable. Now I can see that is not neccessary and I could've just reuse the parameter for the result. Tks.

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว +5

      Right, it's confusing at first glance, and I'm glad that you found this video useful to help understand this probelm! :)

  • @annas8308
    @annas8308 4 ปีที่แล้ว +9

    The walk-through using the stacks and the 2 linked lists as they're being built while the code goes on really helps! Subscribed!

  • @muntajir646
    @muntajir646 ปีที่แล้ว +3

    After watching more than 5 videos I finally understoon the backtracking from this one. really thankful🥰

  • @mirzaarabferuvian136
    @mirzaarabferuvian136 ปีที่แล้ว +2

    Thank you so much, 3 years ago, and it still valuable today!!!, I have been stuck trying to visualize this for hours due to the use of .next, your video just give me clarification, thank you thank you and thank you

    • @FisherCoder
      @FisherCoder  ปีที่แล้ว

      Glad it was helpful! Cheers!

  • @ИринаПерепелкина-д8я
    @ИринаПерепелкина-д8я 3 ปีที่แล้ว +8

    A very good idea to use different colours to present l1 and l2 in different calls, very helpful!

    • @FisherCoder
      @FisherCoder  3 ปีที่แล้ว

      Glad it was helpful!

  • @thienminhnguyen3581
    @thienminhnguyen3581 3 ปีที่แล้ว +3

    Oh it's so greate. I'm confused with Recursion and I foud this video. Thank youu

  • @ianvechey2272
    @ianvechey2272 4 ปีที่แล้ว +5

    Wow, thank you. I found your video as my professor said he would quiz us on sorting multiple and this video was super clear. The implementations on what stacks we're being called was helpful as well. Thank you so much. I know this wouldn't work for 3 but for 2 this was extremely easy to understand.

  • @jenitajebasingh3867
    @jenitajebasingh3867 4 ปีที่แล้ว +7

    Clear explanation! Thanks!

  • @tanhnguyen2025
    @tanhnguyen2025 ปีที่แล้ว +2

    despite your explanation being clear-cut and easy to understand, it's still somehow a little bit confusing for beginners like me to really grasp the ins and outs of how this code actually works under the hood.

    • @FisherCoder
      @FisherCoder  ปีที่แล้ว +1

      Practice makes perfect, try running code locally a few times and you'll get the gist of it.

  • @VidelShaw
    @VidelShaw ปีที่แล้ว +1

    Thank you so much for dry running the code. It helps to visualise what I am seeing> You are amazing!

  • @sezermezgil9304
    @sezermezgil9304 3 ปีที่แล้ว +5

    It is so clear explanation thx but i have a one thing that i didnt understand clearly.I just can't understand the returning part after we recall the function how does it work exactly ?

  • @supax2
    @supax2 2 ปีที่แล้ว +2

    You are absolutely awesome man. Thank you!

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว

      Glad it was helpful! Thank you!

  • @sahilnegi2789
    @sahilnegi2789 3 ปีที่แล้ว +1

    sir U are amazing teacher . love from INDIA

  • @최강재-y9c
    @최강재-y9c 2 ปีที่แล้ว +2

    So explanatory! Many thanks for your visualizations.

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว

      Glad it was helpful!

  • @FullyBR
    @FullyBR 4 ปีที่แล้ว +5

    Thank you so much! I was having trouble understanding the final stack calls and this made it so much better

  • @SumanMondal-cb8yl
    @SumanMondal-cb8yl 4 ปีที่แล้ว +3

    Best Explanation ever❤️❤️❤️❤️. Thank you ❤️❤️

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว

      Glad it was helpful!

  • @ysevanlee7489
    @ysevanlee7489 2 ปีที่แล้ว

    This is the kind of explanation that "gives lemonade seltzer to a heavy stomach" as Koreans have it. Thanks!

  • @abhisheksing6778
    @abhisheksing6778 ปีที่แล้ว +1

    Nice and clear .Thank you so much Fisher Coder

  • @kd_witty
    @kd_witty 2 ปีที่แล้ว +1

    Literally great way of explanation.

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว

      Glad it was helpful!

  • @chithyFly
    @chithyFly 8 หลายเดือนก่อน +1

    Guy, great explanation with code and graph!!! thank you, keep going.

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

      Glad you liked it!

  • @wesammustafa9004
    @wesammustafa9004 3 ปีที่แล้ว +2

    Excellent and Easy explanation, Thank you so much

    • @FisherCoder
      @FisherCoder  3 ปีที่แล้ว +1

      Glad it was helpful!

  • @yynnooot
    @yynnooot 2 ปีที่แล้ว +1

    I wish you went over your thought process for solving this problem. Like what came to mind when you saw this problem and how you thought of your approach.

  • @TharaMesseroux1
    @TharaMesseroux1 3 ปีที่แล้ว +1

    Fisher Coder, thank you so much for being such a great explainer and taking the time to do these videos! May you please do an Amazon leetcode series? Have a great day!

  • @timurradko9798
    @timurradko9798 ปีที่แล้ว +1

    Thank you so much for your clear explanation!

    • @FisherCoder
      @FisherCoder  ปีที่แล้ว +1

      Glad it was helpful!

  • @564151199
    @564151199 3 ปีที่แล้ว

    U r God for new people thanks

  • @algos-datas
    @algos-datas ปีที่แล้ว +1

    Great explanation. Thank you

    • @FisherCoder
      @FisherCoder  ปีที่แล้ว

      Glad it's helpful, thanks!

  • @arpitverma8060
    @arpitverma8060 4 ปีที่แล้ว +3

    Awesome explanation 💯🔥

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว +1

      Glad you liked it!

  • @areebashaikh22
    @areebashaikh22 11 หลายเดือนก่อน +1

    Great explanation. Thanks!!

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

      Glad it helped!

  • @didoma73
    @didoma73 4 ปีที่แล้ว +2

    this was excellent explanation

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว

      Glad you found it helpful! :)

  • @leeoku
    @leeoku 4 ปีที่แล้ว +3

    i'm very bad at visualizing and this was perfect

    • @FisherCoder
      @FisherCoder  4 ปีที่แล้ว +1

      Glad it helped!

    • @leeoku
      @leeoku 4 ปีที่แล้ว +1

      @@FisherCoder no thank you. DS&A in an essence isn't that hard, sometimes you just need a drawn out step by step to get it. And that's what you got.

  • @jameslay6505
    @jameslay6505 2 ปีที่แล้ว +1

    Great explanation of the answer. Perhaps it would be good to explain to your viewers how one derives this solution rationally?

  • @priteshpatel6428
    @priteshpatel6428 3 ปีที่แล้ว +2

    Thank you so so much! I was looking for such an explaination. You just cleared my all doubts :)

    • @FisherCoder
      @FisherCoder  3 ปีที่แล้ว

      Glad it was helpful!

  • @juanmteheranmachado1387
    @juanmteheranmachado1387 ปีที่แล้ว

    God bless you, my estimated man

  • @kennethchen427
    @kennethchen427 2 ปีที่แล้ว +1

    This helped a ton. Thank you so much mate!

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

    great concept

  • @SwagWNL
    @SwagWNL 2 ปีที่แล้ว +1

    Great Explanation. Thanks a lot!

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว

      Glad it was helpful!

  • @ziedbrahmi4812
    @ziedbrahmi4812 4 ปีที่แล้ว +3

    thank you

  • @uUwUu69
    @uUwUu69 28 วันที่ผ่านมา

    dude you're a genius

  • @umeshjoshi8047
    @umeshjoshi8047 2 ปีที่แล้ว +1

    Great explanation man

  • @madhavmohan5754
    @madhavmohan5754 2 ปีที่แล้ว +1

    You're awesome bro..

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

    I loved the explanation. The thing is I can understand from he code, but I cannot understand and then code. How to think in a way to write code not read the code? Any tips especially for recursion?

  • @vinhlequang9959
    @vinhlequang9959 ปีที่แล้ว +1

    It was perfect. thank you

  • @codelen8121
    @codelen8121 2 ปีที่แล้ว +1

    Thank you so much!!!

  • @travelnlearn
    @travelnlearn 2 ปีที่แล้ว +1

    Very very nice video

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว

      Thank you so much 😀

  • @shyamprasanna4323
    @shyamprasanna4323 4 ปีที่แล้ว +2

    Thanks for helping

  • @qianfeng3740
    @qianfeng3740 3 ปีที่แล้ว +1

    thank you so much!

  • @jey_n_code
    @jey_n_code ปีที่แล้ว +1

    LEGIT HUGE THANKSSS!

    • @jey_n_code
      @jey_n_code ปีที่แล้ว +1

      ESPECIALLY THE PART ABOUT HOW RECURSIVE CALLS ARE WORKING

    • @FisherCoder
      @FisherCoder  ปีที่แล้ว

      Glad it's helpful!

  • @vivekbharti1792
    @vivekbharti1792 2 ปีที่แล้ว +1

    liked it a lot

  • @holowichigo1
    @holowichigo1 2 ปีที่แล้ว +1

    amazing stuff :)

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว +1

      Glad you think so!

  • @naimulmushfiq1390
    @naimulmushfiq1390 2 ปีที่แล้ว +1

    thanks man

  • @freesoul2677
    @freesoul2677 3 ปีที่แล้ว +1

    Thank you !!!

  • @mouadet-tali4089
    @mouadet-tali4089 2 ปีที่แล้ว +1

    this
    was
    beautiful

    • @FisherCoder
      @FisherCoder  2 ปีที่แล้ว +1

      Thank you! Glad you found it helpful!

    • @mouadet-tali4089
      @mouadet-tali4089 2 ปีที่แล้ว

      @@FisherCoder cleared up so many lagging ideas . Thanks again

  • @PramodRj
    @PramodRj 4 ปีที่แล้ว +1

    Good Job!

  • @siddhanttyagi6653
    @siddhanttyagi6653 3 ปีที่แล้ว +1

    great explination.keep it up bro.

  • @doaaemam2869
    @doaaemam2869 4 ปีที่แล้ว +1

    very nice explaining, but I think the memory space is O(1) because you don't call stack or use push & pop method here

    • @parthsalat
      @parthsalat 4 ปีที่แล้ว +2

      Internally, a stack is used to maintain recursive function calls.

  • @jianxue2945
    @jianxue2945 ปีที่แล้ว

    What does return l1 or return l2 do in the recursive if else statement? Return the current pointer?

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

      @@Tren9528 it returns pointer l1 or l2 after function calls are released from stack. Watch the second half of the video when he steps through the code. Recursive functions sits in the stack and on top of each other. When the recursive function finally reached to the base case, it starts to make return value and pass the value to the function sitting below it while the current function is popped off the stack after the work is done. The return value will be either l1 or l2 which are the pointers that point to the finish product. The pointer will be reassigned each time before functions are popped off the stack.

  • @lacosteamine1286
    @lacosteamine1286 ปีที่แล้ว +1

    thnx a lot

  • @skankhunt-mt5uz
    @skankhunt-mt5uz 4 ปีที่แล้ว +1

    You are a good looking guy, you look like me but older

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

    0 sec ..