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

Поделиться
HTML-код
  • Опубликовано: 9 ноя 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! :)

  • @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

  • @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!

  • @ИринаПерепелкина-д8я
    @ИринаПерепелкина-д8я 3 года назад +8

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

  • @muntajir646
    @muntajir646 11 месяцев назад +3

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

  • @VidelShaw
    @VidelShaw Год назад +1

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

  • @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.

  • @최강재-y9c
    @최강재-y9c 2 года назад +2

    So explanatory! Many thanks for your visualizations.

  • @timurradko9798
    @timurradko9798 Год назад +1

    Thank you so much for your clear explanation!

  • @chithyFly
    @chithyFly 8 месяцев назад +1

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

  • @abhisheksing6778
    @abhisheksing6778 Год назад +1

    Nice and clear .Thank you so much Fisher Coder

  • @FullyBR
    @FullyBR 4 года назад +5

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

  • @supax2
    @supax2 2 года назад +2

    You are absolutely awesome man. Thank you!

    • @FisherCoder
      @FisherCoder  2 года назад

      Glad it was helpful! Thank you!

  • @algos-datas
    @algos-datas Год назад +1

    Great explanation. Thank you

  • @tanhnguyen2025
    @tanhnguyen2025 11 месяцев назад +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  11 месяцев назад +1

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

  • @SumanMondal-cb8yl
    @SumanMondal-cb8yl 4 года назад +3

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

  • @areebashaikh22
    @areebashaikh22 10 месяцев назад +1

    Great explanation. Thanks!!

  • @wesammustafa9004
    @wesammustafa9004 3 года назад +2

    Excellent and Easy explanation, Thank you so much

  • @ysevanlee7489
    @ysevanlee7489 2 года назад

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

  • @sahilnegi2789
    @sahilnegi2789 3 года назад +1

    sir U are amazing teacher . love from INDIA

  • @kd_witty
    @kd_witty 2 года назад +1

    Literally great way of explanation.

  • @jenitajebasingh3867
    @jenitajebasingh3867 4 года назад +7

    Clear explanation! Thanks!

  • @AshishGupta-xw9yh
    @AshishGupta-xw9yh 5 месяцев назад +1

    great concept

  • @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 ?

  • @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!

  • @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.

  • @SwagWNL
    @SwagWNL 2 года назад +1

    Great Explanation. Thanks a lot!

  • @juanmteheranmachado1387
    @juanmteheranmachado1387 Год назад

    God bless you, my estimated man

  • @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?

  • @codelen8121
    @codelen8121 2 года назад +1

    Thank you so much!!!

  • @vinhlequang9959
    @vinhlequang9959 Год назад +1

    It was perfect. thank you

  • @priteshpatel6428
    @priteshpatel6428 3 года назад +2

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

  • @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.

  • @564151199
    @564151199 3 года назад

    U r God for new people thanks

  • @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?

  • @uUwUu69
    @uUwUu69 11 дней назад

    dude you're a genius

  • @travelnlearn
    @travelnlearn 2 года назад +1

    Very very nice video

  • @didoma73
    @didoma73 4 года назад +2

    this was excellent explanation

    • @FisherCoder
      @FisherCoder  4 года назад

      Glad you found it helpful! :)

  • @arpitverma8060
    @arpitverma8060 4 года назад +3

    Awesome explanation 💯🔥

  • @qianfeng3740
    @qianfeng3740 3 года назад +1

    thank you so much!

  • @kennethchen427
    @kennethchen427 2 года назад +1

    This helped a ton. Thank you so much mate!

  • @umeshjoshi8047
    @umeshjoshi8047 2 года назад +1

    Great explanation man

  • @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!

  • @freesoul2677
    @freesoul2677 3 года назад +1

    Thank you !!!

  • @madhavmohan5754
    @madhavmohan5754 2 года назад +1

    You're awesome bro..

  • @shyamprasanna4323
    @shyamprasanna4323 4 года назад +2

    Thanks for helping

  • @vivekbharti1792
    @vivekbharti1792 2 года назад +1

    liked it a lot

  • @holowichigo1
    @holowichigo1 2 года назад +1

    amazing stuff :)

  • @naimulmushfiq1390
    @naimulmushfiq1390 2 года назад +1

    thanks man

  • @lacosteamine1286
    @lacosteamine1286 Год назад +1

    thnx a lot

  • @PramodRj
    @PramodRj 3 года назад +1

    Good Job!

  • @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

  • @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.

  • @ziedbrahmi4812
    @ziedbrahmi4812 4 года назад +3

    thank you

  • @siddhanttyagi6653
    @siddhanttyagi6653 3 года назад +1

    great explination.keep it up bro.

  • @jianxue2945
    @jianxue2945 Год назад

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

    • @jianxue2945
      @jianxue2945 8 месяцев назад

      @@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.

  • @skankhunt-mt5uz
    @skankhunt-mt5uz 4 года назад +1

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

  • @Dstoic
    @Dstoic 4 месяца назад

    0 sec ..