The way you approach a new problem is something I'd really like to learn. Amazing explanation as usual. What software do you use for video recording and editing? Is this iPad mirrored on the screen and then screen recorded?
You are awesome and I love your video explanations! My solution was similar but instead of using a stack, I reversed the created list for each level and added it to the final answer list based on the boolean flag. Is it the same as your solution as far as Time and Space complexity, or is it worse?
space complexity is simply the extra space we use to arrive at our solution. We use a stack, that can have the maximum of n elements in the worst case. Hence, space complexity is O(n)
There is a small mistake in the code while adding popped element from stack to level, which is self explanatory: Fixed code: TreeNode node = reverseStack.pop(); level.add(node.val); Appreciate your effort, thanks.
Loved the explanation. I like the way you teach. Thanks for great content !!
Congratulations for 10k 🥳
Thanks! After watching this video I was able to solve a similar leetcode question, "Binary Tree Right Side View"
that is wonderful
loved the approach. writing how we made queue for level order and then thinking about how we can achieve zig zag pattern with small tweaks. thanks😇
Glad you liked it.
Best Explanation. Keep doing good work.
Very good explanation 🎉❤
Thanks for the love!
Thank you for the wonderful explanation sir
thanks for awesome explanation !
sir i would say you have great approach and explanation skill if you have done a great marketing then you may have thousands of views
As always very nice explanation, I would like to suggest a tweak instead of using stack we could simply reverse temporayList at alternate iteration.
That's a great idea!
The way you approach a new problem is something I'd really like to learn. Amazing explanation as usual.
What software do you use for video recording and editing? Is this iPad mirrored on the screen and then screen recorded?
I use final cut pro for all the edits, and on iPad I use GoodNotes 5
@@nikoo28 Thank you :)
You are awesome and I love your video explanations!
My solution was similar but instead of using a stack, I reversed the created list for each level and added it to the final answer list based on the boolean flag. Is it the same as your solution as far as Time and Space complexity, or is it worse?
as long as the time and space complexity is same, doesn't really matter
Understood
can you also explain how we compute the space complexity for this ?
space complexity is simply the extra space we use to arrive at our solution. We use a stack, that can have the maximum of n elements in the worst case. Hence, space complexity is O(n)
There is a small mistake in the code while adding popped element from stack to level, which is self explanatory:
Fixed code:
TreeNode node = reverseStack.pop();
level.add(node.val);
Appreciate your effort, thanks.
Thanks for clearing it out. :)
which line??even the one on screen is running correct
sir could u pls make a video on boundary order traversal .
can you give me an example link?
hi sir.
I seen Ur backtracking video , I commented below that video can u replay for that comment.
How can I help you?
@@nikoo28 I want more default problems with solutions on backtracking algorithm can u Make problems on that ,sir
Bro for instead of stack we can simply reverse a vector
Batao m puch rha hu😅
please start graph problems also anna
Did you have a look at my playlist on graphs?
Hey Nikhil, I have messaged you on LinkedIn.