Thanks, you were able to simplify the problem and its solution for me :)
@kunalkheeva Жыл бұрын
Thank you for the edge cases.
@luminraja096 ай бұрын
I am a fan of BFS. Thanks Man for the solution. :)
@dineshdsv781510 ай бұрын
Thanks for the explanation!!
@nikoo2810 ай бұрын
Happy to help!
@alisheheryar17708 ай бұрын
Godspeed Nikhil.
@AniketWaghmare-qi7wm2 ай бұрын
Bro please make video on Question Number 110. Balanced Binary Tree.and your Teaching technique is so good. Please make video urjently because my Amazon interview schedule in next week
@unemployedcse35143 ай бұрын
awesome ❤
@brentdaniels5462 Жыл бұрын
Can you do a tutorial on the recusive solution? figiured out the itreative solution but I am still a little bit confused on how the recusive solution works.
@nikoo28 Жыл бұрын
if you understand the iterative solution, that is all you need. A recursive solution if often confusing. If you still want a recursive solution, you might find one in the leetcode discuss section. I would not recommend it though
@subee12810 ай бұрын
Thanks
@LOUD_Ruffian Жыл бұрын
Which one is better? recursive or iterative? Recursive solutions comes naturally to for trees usually.
@nikoo28 Жыл бұрын
i usually prefer an iterative approach, as it is more easy to debug. Think about a scenario when you are trying to understand the flow and find what is going wrong. With a recursive approach, you will get stuck in cycles, and it gets very hard. At the end it comes down to preference.
@mdshafiuddin1234 Жыл бұрын
sir please make playlist on recursion this concept is root for all advance concept of dsa
@nikoo28 Жыл бұрын
yes, I will add a playlist on recursion.
@leetcode650 Жыл бұрын
Please do solution in python or make a poll :(
@nikoo2811 ай бұрын
try to understand the logic rather than concentrating on the language :)
@@Amed-pf7dp The space complexity of this solution is O(n) in the worst case, as the recursive calls will use space on the call stack proportional to the height of the tree
@philandros31959 ай бұрын
I don't think I understand how the tree works. In the first test case the trees are q = [1, 2, 3] and p = [1, 2, 3] and if I write: return q.val == p.val and q.left == p.left and q.right == p.right, the output is False??? Also if I try just return q (for science), I would expect the output to be the tree [1,2,3], but instead the output is True?? What the fuck. How do these damn trees work?!?
@nikoo288 ай бұрын
check out my complete playlist on trees, you will have a very good understanding.