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.
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 it would be helpful if these are kept in different playlists based on topic as well.
Thanks for this best explanation . Your work is appreciable.
Thanks 🙏🏻
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)
🙏🙏🙏🙏
Thanks! for sharing.
Can we use inorder or preorder traversal..?
expected good explanation
Sorry to disappoint you, will try harder next time :)
nice explanation
Thank you
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)