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
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) 🙏🙏🙏🙏
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.
expected good explanation
Sorry to disappoint you, will try harder next time :)
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
Thanks for this best explanation . Your work is appreciable.
Thanks 🙏🏻
Thanks! for sharing.
Thank you
nice explanation
Mam it would be helpful if these are kept in different playlists based on topic as well.
Time complexity of second approach is also o(n^2) but not o(n)
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)
🙏🙏🙏🙏
Can we use inorder or preorder traversal..?
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.
👍👍👍
First one
yes i want O(N). Thanks❤
Time complexity of second approach is also o(n^2) but not o(n)
Time complexity of second approach is also o(n^2) but not o(n)