Find Duplicate Subtrees | Leetcode 652 | Binary Trees

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

КОМЕНТАРІ • 17

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

    expected good explanation

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

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

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

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

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

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

    Thanks! for sharing.

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

    Thank you

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

    nice explanation

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

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

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

  • @ombhandari6148
    @ombhandari6148 11 місяців тому +1

    Can we use inorder or preorder traversal..?

  • @user-me1pk5rg4u
    @user-me1pk5rg4u 11 місяців тому +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)