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

Поділитися
Вставка
  • Опубліковано 8 січ 2025

КОМЕНТАРІ • 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!

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

  • @ИринаПерепелкина-д8я

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

  • @VidelShaw
    @VidelShaw Рік тому +1

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

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

  • @thienminhnguyen3581
    @thienminhnguyen3581 3 роки тому +3

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

  • @muntajir646
    @muntajir646 Рік тому +3

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

  • @최강재-y9c
    @최강재-y9c 2 роки тому +2

    So explanatory! Many thanks for your visualizations.

  • @FullyBR
    @FullyBR 4 роки тому +5

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

  • @chithyFly
    @chithyFly 10 місяців тому +1

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

  • @jenitajebasingh3867
    @jenitajebasingh3867 4 роки тому +7

    Clear explanation! Thanks!

  • @ysevanlee7489
    @ysevanlee7489 2 роки тому

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

  • @supax2
    @supax2 2 роки тому +2

    You are absolutely awesome man. Thank you!

    • @FisherCoder
      @FisherCoder  2 роки тому

      Glad it was helpful! Thank you!

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

  • @abhisheksing6778
    @abhisheksing6778 Рік тому +1

    Nice and clear .Thank you so much Fisher Coder

  • @priteshpatel6428
    @priteshpatel6428 3 роки тому +2

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

  • @timurradko9798
    @timurradko9798 Рік тому +1

    Thank you so much for your clear explanation!

  • @sahilnegi2789
    @sahilnegi2789 3 роки тому +1

    sir U are amazing teacher . love from INDIA

  • @kd_witty
    @kd_witty 2 роки тому +1

    Literally great way of explanation.

  • @frameworklabs
    @frameworklabs 3 роки тому +2

    Excellent and Easy explanation, Thank you so much

  • @SumanMondal-cb8yl
    @SumanMondal-cb8yl 4 роки тому +3

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

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

  • @kennethchen427
    @kennethchen427 2 роки тому +1

    This helped a ton. Thank you so much mate!

  • @yynnooot
    @yynnooot 3 роки тому +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.

  • @algos-datas
    @algos-datas Рік тому +1

    Great explanation. Thank you

  • @areebashaikh22
    @areebashaikh22 Рік тому +1

    Great explanation. Thanks!!

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

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

  • @arpitverma8060
    @arpitverma8060 4 роки тому +3

    Awesome explanation 💯🔥

  • @didoma73
    @didoma73 4 роки тому +2

    this was excellent explanation

  • @AshishGupta-xw9yh
    @AshishGupta-xw9yh 7 місяців тому +1

    great concept

  • @SwagWNL
    @SwagWNL 2 роки тому +1

    Great Explanation. Thanks a lot!

  • @Virtualexist
    @Virtualexist 7 місяців тому

    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?

  • @juanmteheranmachado1387
    @juanmteheranmachado1387 Рік тому

    God bless you, my estimated man

  • @umeshjoshi8047
    @umeshjoshi8047 2 роки тому +1

    Great explanation man

  • @vinhlequang9959
    @vinhlequang9959 Рік тому +1

    It was perfect. thank you

  • @travelnlearn
    @travelnlearn 2 роки тому +1

    Very very nice video

  • @564151199
    @564151199 3 роки тому

    U r God for new people thanks

  • @codelen8121
    @codelen8121 3 роки тому +1

    Thank you so much!!!

  • @ziedbrahmi4812
    @ziedbrahmi4812 4 роки тому +3

    thank you

  • @madhavmohan5754
    @madhavmohan5754 3 роки тому +1

    You're awesome bro..

  • @uUwUu69
    @uUwUu69 2 місяці тому

    dude you're a genius

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

  • @siddhanttyagi6653
    @siddhanttyagi6653 4 роки тому +1

    great explination.keep it up bro.

  • @shyamprasanna4323
    @shyamprasanna4323 4 роки тому +2

    Thanks for helping

  • @jianxue2945
    @jianxue2945 Рік тому

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

    • @jianxue2945
      @jianxue2945 10 місяців тому

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

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

  • @holowichigo1
    @holowichigo1 2 роки тому +1

    amazing stuff :)

  • @qianfeng3740
    @qianfeng3740 3 роки тому +1

    thank you so much!

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

  • @freesoul2677
    @freesoul2677 3 роки тому +1

    Thank you !!!

  • @vivekbharti1792
    @vivekbharti1792 3 роки тому +1

    liked it a lot

  • @naimulmushfiq1390
    @naimulmushfiq1390 2 роки тому +1

    thanks man

  • @skankhunt-mt5uz
    @skankhunt-mt5uz 4 роки тому +1

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

  • @lacosteamine1286
    @lacosteamine1286 Рік тому +1

    thnx a lot

  • @Dstoic
    @Dstoic 6 місяців тому

    0 sec ..