Lowest Common Ancestor of a binary tree | Leetcode

Поділитися
Вставка
  • Опубліковано 25 лис 2024

КОМЕНТАРІ • 56

  • @jlecampana
    @jlecampana 2 роки тому +11

    You're an excellent teacher, I've learned so much from your videos, you explain recursion beautifully, Thank you!

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

    I don't comment very often on videos, but yours really helped me. Thank you so much

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

    you explaied node tree recursion like a class 8th maths problem. Bro you're a genius.

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

    Happy teacher's day Sir...

  • @embarrassed_dodo
    @embarrassed_dodo 5 місяців тому

    Awesome explanation, I had trouble understanding this earlier but now i get it

  • @linlyu8321
    @linlyu8321 10 днів тому

    Thank you so much, very clear and helpful video!

  • @DaudZaidi
    @DaudZaidi 3 роки тому +6

    Nice one. Please do Leetcode 621 - Task Scheduler.

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

      Sure 👍🏼

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

      @TECH DOSE, Yes! Please do 621! Thank you!

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

    Best expalnation ever

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

    great explanation theyw ay you explain the question by all possibe senario is superb

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

    Man, you're awesome as always!

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

    Thanks

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

    Great explanation.

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

    Great stuff! 👍🏻

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

    Very nice explanation. Thank you

  • @areebashaikh22
    @areebashaikh22 11 місяців тому

    Thank you!

  • @annawilson3824
    @annawilson3824 3 роки тому +5

    TECH DOSE, do you plan to add playlists according to the Leetcode's difficulty level? That would increase views for you and help the audience to watch the whole list of problems that they target. Thanks.

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

    THIS IS AWESOME.

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

    Nicely explained !!

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

    Thanks brother

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

    Very smart! Thanks

  • @ui.ashish
    @ui.ashish 3 роки тому +2

    amazing content

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

    What is the editor name?

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

    Very much excited

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

    Thanks a lot sir :)

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

    Excellent.

  • @sunny-14689
    @sunny-14689 3 роки тому +1

    Can you also discuss on side how to solve if links to parent is present (i.e each node contains link to parent) ?

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

    Wait is over. 😊

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

    Awesome!!

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

    Your final commentary is a lot confusing and doesn’t explain why you return left or right when the other is null. It is because when right is null you found both modes on left so the left node down is LCA and vice-versa

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

      Take some examples and it will be clear for sure

  • @sibiranganath
    @sibiranganath Місяць тому

    Understood

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

    👏👏👏

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

    This makes unnecessary work. Imagine that both nodes are on the left, your code still explores the entire right subtree, when it could already stop the search there. You can keep state locally in the class or use an helper method with an additional settable field to avoid this. On the other hand, the fact that you don't continue the search down the subtrees when root matches one of the nodes, reduces the search space, so depending on the case, it might end up being better or worse.

  • @SibiRanganathL
    @SibiRanganathL Місяць тому

    Uderstood

  • @maruthkamath9304
    @maruthkamath9304 8 місяців тому

    ~12.30 is wrong.LCA could have been 5 also . So the conclusion is wrong. I guess needs an edit.

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

    such an awful explanation