Find Duplicate Subtrees | Leetcode 652 | Binary Trees

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

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

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

    Time complexity of second approach is also o(n^2) but not o(n) because concatenation of string takes o(n) and in every recursion call string is concatenated

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

    Mam it would be helpful if these are kept in different playlists based on topic as well.

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

    Thanks for this best explanation . Your work is appreciable.
    Thanks 🙏🏻

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

    Time complexity of second approach is also o(n^2) but not o(n)

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

    mam if we want found time complexity some given algorithms there is concept (TAKE LOG BOTH SIDES) this concept I want to learn
    which class I can find this concept in
    (school nd college time in mathematics)
    🙏🙏🙏🙏

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

    Thanks! for sharing.

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

    Can we use inorder or preorder traversal..?

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

    expected good explanation

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

      Sorry to disappoint you, will try harder next time :)

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

    nice explanation

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

    Thank you

  • @BHASKARAGRAWAL-v5s
    @BHASKARAGRAWAL-v5s ปีที่แล้ว +1

    second approach is wrong as per the LeetCode constraints. value lies from -200 to +200, so return 0 in case of NULL does not make sense. and complexity is same as before. N*N. First one is good.

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

    👍👍👍

  • @JitendraKumar-ll4lz
    @JitendraKumar-ll4lz ปีที่แล้ว

    First one

  • @VineetKumar-pj1bk
    @VineetKumar-pj1bk ปีที่แล้ว

    yes i want O(N). Thanks❤

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

      Time complexity of second approach is also o(n^2) but not o(n)

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

    Time complexity of second approach is also o(n^2) but not o(n)