We hope you all are enjoying our videos!!! Don't forget to leave a comment!!! Please like the video to support us!!! Questions you might like: ✅✅✅[ Tree Data Structure] : kzbin.info/aero/PLJtzaiEpVo2zx-rCqLMmcFEpZw1UpGWls ✅✅✅[ Graphs Data Structure] : kzbin.info/aero/PLJtzaiEpVo2xg89cZzZCHqX03a1Vb6w7C ✅✅✅[ January 2021 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2wCalBcRcNjXQ0C6ku3dRkn ✅✅✅[ February 2021 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2wrfvII0eZQsPm-MZCmHodm ✅✅✅[ March 2021 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2zH-YC5ZiptbAvw2QZkmyk9 ✅✅✅[ April 2021 Leetcoding Challenge] :kzbin.info/aero/PLJtzaiEpVo2z9PpcJcsl5j3RXutiTU-GB ✅✅✅[ December 2020 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2xo8OdPZxrpybGR8FmzZpCA ✅✅✅[ November 2020 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2yMYz5RPH6pfB0wNnwWsK7e ✅✅✅[ August 2020 Leetcoding Challenge] : kzbin.info/aero/PLJtzaiEpVo2xu4h0gYQzvOMboclK_pZMe ✅✅✅[ July 2020 Leetcoding challenges] : kzbin.info/aero/PLJtzaiEpVo2wrUwkvexbC-vbUqVIy7qC- ✅✅✅[ June 2020 Leetcoding challenges] : kzbin.info/aero/PLJtzaiEpVo2xIPptnCvUtKrUcod2zAKG ✅✅✅[ May 2020 Leetcoding challenges] : kzbin.info/aero/PLJtzaiEpVo2wRmUCq96zsUwOVD6p66K9e ✅✅✅ Cracking the Coding Interview - Unique String: kzbin.info/aero/PLJtzaiEpVo2xXf4LZb3y_BopOnLC1L4mE Struggling in a question?? Leave in a comment and we will make a video!!!🙂🙂🙂
@miguelangelfigueroadelgado13813 жыл бұрын
The time complexity of the first approach is O(n^2) because of the while loop will be traversing the nodes on each recursive call, don't you think so?
@AviatorBro3 жыл бұрын
it will be O(n) only, because it's recursion. try doing it on paper and drawing the recursion tree
@miguelangelfigueroadelgado13813 жыл бұрын
@@AviatorBro the while loop to find the last element to which you add the right (min 6:00), that loop can traverse all elements so O(n) at each recursive call
@numseidizer3 жыл бұрын
Yes, O(n²).
@vibhoragarwal54253 жыл бұрын
Correct O(n2)
@poorpanda9033 Жыл бұрын
What a great explanation ! Please do more leetcode questions !
@3darpan3 жыл бұрын
Your first solution is definitely not in O(n) time complexity, although the space complexity is correct.
@brendanvoelz2 жыл бұрын
Agreed. It's O(n log n) assuming the tree is balanced
@adithyakashyap643 жыл бұрын
I have seen 10 different varioations of code in different videos and in discussion section of LeetCode. Nothing was explained so simple and clear . Way to go !!
@AlgorithmsMadeEasy3 жыл бұрын
Glad it was helpful! Don't forget to share and subscribe!!
@akkzhol13 жыл бұрын
Thanks for your videos! Brief and clear!
@geekySRM3 жыл бұрын
This was the only video I understood from! Thanks a ton!
@AlgorithmsMadeEasy3 жыл бұрын
Glad you like it !!
@xinchenyi98783 жыл бұрын
Agree! I finally understood Morris Traverse from this video!
@nikhilaggarwal93253 жыл бұрын
Highly underrated channel, the way you both explain the code is really cool. It's high time for this channel to get it's deserving reach. Hope it really grows fast.
@AlgorithmsMadeEasy3 жыл бұрын
Glad you think so!
@rajeevsai912 жыл бұрын
Very clear explanation. Animations were also superb. Happy that I found this channel.
@AlgorithmsMadeEasy2 жыл бұрын
Glad to hear that!
@vamsiarja125811 ай бұрын
This is a really great explanation🤩
@AlgorithmsMadeEasy10 ай бұрын
Glad it was helpful!
@uttarandas81133 жыл бұрын
Great explanation. Short and sweet.
@siddharthdwivedi32633 жыл бұрын
Nicely explained ,with clear visualization and best possible intuition!!
@AlgorithmsMadeEasy3 жыл бұрын
Thanks. Glad you liked it !!
@vyankateshkulkarni43742 жыл бұрын
thank you mam for great explanation.
@bruteforce6763 жыл бұрын
Loved the way of explanation
@edwinanto2003 Жыл бұрын
great explanation.. Thank you so much 👍
@vivekpaliwal1876 Жыл бұрын
Nice visual explanation
@programmer52803 жыл бұрын
Best Explaination🔥.. Finally I Understand the Concept of this question. Thanks alot!!
@AlgorithmsMadeEasy3 жыл бұрын
Happy to help
@i.vigneshdavid16983 жыл бұрын
Nicely Explained
@jackwalker29473 жыл бұрын
Nice Explanation thanks❣️
@AlgorithmsMadeEasy3 жыл бұрын
Thanks!
@eecs4823 жыл бұрын
This is great solution. Thank you
@謝育能-s5s9 ай бұрын
Good explanation .
@AlgorithmsMadeEasy6 ай бұрын
Thankyou
@hymnish_you3 жыл бұрын
I binge your channel :D Such an awesome explanation of each problem and I got to know about Morris's behavior. Thanks
@AlgorithmsMadeEasy3 жыл бұрын
Happy to help!
@commentator24072 жыл бұрын
very helpful
@AyushKumar-fk5lm3 жыл бұрын
Amazing! Absolutely loved it. Subscribed channel :)
@AlgorithmsMadeEasy3 жыл бұрын
Thanks Ayush !!
@rahulbabu91413 жыл бұрын
Thank you for excellent explanation mam
@AlgorithmsMadeEasy3 жыл бұрын
Happy to help !!
@anaygondhalekar73309 ай бұрын
Thanks a lott
@AlgorithmsMadeEasy8 ай бұрын
Welcome 👍
@saarthjhaveri87163 жыл бұрын
superb explainationnnn
@sakshiramsinghani52843 жыл бұрын
Nice and clear explanation. I was stuck on this problem for a long time. Keep up the good work 👍
@AlgorithmsMadeEasy3 жыл бұрын
Glad you like it !!
@feelyourbeat78202 жыл бұрын
Great
@AlgorithmsMadeEasy2 жыл бұрын
Thanks
@Nine73833 жыл бұрын
Can someone explain why the recursive algorithm is O(N) and not O(N^2) since there is a while loop?
@ketanahuja89393 жыл бұрын
We are going to every node at most once , thats why ,, think always in this way , how many times i m going to 1 node , u will get clear idea in tree recursive solutions..Thanks
@manishperiwal5153 жыл бұрын
How is the second solution working, since we changed the root.
@anamariaaguilarcahuana94173 жыл бұрын
Hello Khushbu I am currently 17 years old, I saw several of your videos and you always mention the time of complexity, my question is How do you find that time, do you recommend a book to learn and practice? Thank you, your videos inspire me to be better
@AlgorithmsMadeEasy3 жыл бұрын
Thanks for your comment Ana. For time complexity, you can refer a lot of books. Mostly, every book that has DSA will start with explaining complexity analysis. For example "Data Structures and Algorithms" by Narsimha Karumanchi OR "Cracking the Coding Interview" by Gayle McDowell