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 Жыл бұрын
Thanks for this best explanation . Your work is appreciable. Thanks 🙏🏻
@ombhandari6148 Жыл бұрын
Can we use inorder or preorder traversal..?
@aditiraj90923 ай бұрын
expected good explanation
@AyushiSharmaDSA3 ай бұрын
Sorry to disappoint you, will try harder next time :)
@forgedinstudies5853 Жыл бұрын
Thanks! for sharing.
@piaknow3881 Жыл бұрын
Mam it would be helpful if these are kept in different playlists based on topic as well.
@Viralmems_xyz Жыл бұрын
nice explanation
@codecreww Жыл бұрын
Thank you
@onesideoflife3724 Жыл бұрын
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) 🙏🙏🙏🙏
@mdhaidarparwez968 Жыл бұрын
Time complexity of second approach is also o(n^2) but not o(n)
@ashjournal Жыл бұрын
👍👍👍
@BHASKARAGRAWAL-v5s Жыл бұрын
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.
@JitendraKumar-ll4lz Жыл бұрын
First one
@VineetKumar-pj1bk Жыл бұрын
yes i want O(N). Thanks❤
@mdhaidarparwez968 Жыл бұрын
Time complexity of second approach is also o(n^2) but not o(n)
@mdhaidarparwez968 Жыл бұрын
Time complexity of second approach is also o(n^2) but not o(n)