Flatten Binary Tree to Linked List | Live Coding with Explanation | Leetcode - 114

  Рет қаралды 15,678

Algorithms Made Easy

Algorithms Made Easy

Күн бұрын

Пікірлер: 59
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
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!!!🙂🙂🙂
@miguelangelfigueroadelgado1381
@miguelangelfigueroadelgado1381 3 жыл бұрын
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?
@AviatorBro
@AviatorBro 3 жыл бұрын
it will be O(n) only, because it's recursion. try doing it on paper and drawing the recursion tree
@miguelangelfigueroadelgado1381
@miguelangelfigueroadelgado1381 3 жыл бұрын
@@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
@numseidizer
@numseidizer 3 жыл бұрын
Yes, O(n²).
@vibhoragarwal5425
@vibhoragarwal5425 3 жыл бұрын
Correct O(n2)
@poorpanda9033
@poorpanda9033 Жыл бұрын
What a great explanation ! Please do more leetcode questions !
@3darpan
@3darpan 3 жыл бұрын
Your first solution is definitely not in O(n) time complexity, although the space complexity is correct.
@brendanvoelz
@brendanvoelz 2 жыл бұрын
Agreed. It's O(n log n) assuming the tree is balanced
@adithyakashyap64
@adithyakashyap64 3 жыл бұрын
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 !!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Glad it was helpful! Don't forget to share and subscribe!!
@akkzhol1
@akkzhol1 3 жыл бұрын
Thanks for your videos! Brief and clear!
@geekySRM
@geekySRM 3 жыл бұрын
This was the only video I understood from! Thanks a ton!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Glad you like it !!
@xinchenyi9878
@xinchenyi9878 3 жыл бұрын
Agree! I finally understood Morris Traverse from this video!
@nikhilaggarwal9325
@nikhilaggarwal9325 3 жыл бұрын
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.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Glad you think so!
@rajeevsai91
@rajeevsai91 2 жыл бұрын
Very clear explanation. Animations were also superb. Happy that I found this channel.
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Glad to hear that!
@vamsiarja1258
@vamsiarja1258 11 ай бұрын
This is a really great explanation🤩
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 10 ай бұрын
Glad it was helpful!
@uttarandas8113
@uttarandas8113 3 жыл бұрын
Great explanation. Short and sweet.
@siddharthdwivedi3263
@siddharthdwivedi3263 3 жыл бұрын
Nicely explained ,with clear visualization and best possible intuition!!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks. Glad you liked it !!
@vyankateshkulkarni4374
@vyankateshkulkarni4374 2 жыл бұрын
thank you mam for great explanation.
@bruteforce676
@bruteforce676 3 жыл бұрын
Loved the way of explanation
@edwinanto2003
@edwinanto2003 Жыл бұрын
great explanation.. Thank you so much 👍
@vivekpaliwal1876
@vivekpaliwal1876 Жыл бұрын
Nice visual explanation
@programmer5280
@programmer5280 3 жыл бұрын
Best Explaination🔥.. Finally I Understand the Concept of this question. Thanks alot!!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Happy to help
@i.vigneshdavid1698
@i.vigneshdavid1698 3 жыл бұрын
Nicely Explained
@jackwalker2947
@jackwalker2947 3 жыл бұрын
Nice Explanation thanks❣️
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks!
@eecs482
@eecs482 3 жыл бұрын
This is great solution. Thank you
@謝育能-s5s
@謝育能-s5s 9 ай бұрын
Good explanation .
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 6 ай бұрын
Thankyou
@hymnish_you
@hymnish_you 3 жыл бұрын
I binge your channel :D Such an awesome explanation of each problem and I got to know about Morris's behavior. Thanks
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Happy to help!
@commentator2407
@commentator2407 2 жыл бұрын
very helpful
@AyushKumar-fk5lm
@AyushKumar-fk5lm 3 жыл бұрын
Amazing! Absolutely loved it. Subscribed channel :)
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Thanks Ayush !!
@rahulbabu9141
@rahulbabu9141 3 жыл бұрын
Thank you for excellent explanation mam
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Happy to help !!
@anaygondhalekar7330
@anaygondhalekar7330 9 ай бұрын
Thanks a lott
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 8 ай бұрын
Welcome 👍
@saarthjhaveri8716
@saarthjhaveri8716 3 жыл бұрын
superb explainationnnn
@sakshiramsinghani5284
@sakshiramsinghani5284 3 жыл бұрын
Nice and clear explanation. I was stuck on this problem for a long time. Keep up the good work 👍
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Glad you like it !!
@feelyourbeat7820
@feelyourbeat7820 2 жыл бұрын
Great
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 2 жыл бұрын
Thanks
@Nine7383
@Nine7383 3 жыл бұрын
Can someone explain why the recursive algorithm is O(N) and not O(N^2) since there is a while loop?
@ketanahuja8939
@ketanahuja8939 3 жыл бұрын
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
@manishperiwal515
@manishperiwal515 3 жыл бұрын
How is the second solution working, since we changed the root.
@anamariaaguilarcahuana9417
@anamariaaguilarcahuana9417 3 жыл бұрын
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
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
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
@kotlintpoint4290
@kotlintpoint4290 3 жыл бұрын
Nice tutorial...i like it!!!
@AlgorithmsMadeEasy
@AlgorithmsMadeEasy 3 жыл бұрын
Glad to hear that!
@commentator2407
@commentator2407 2 жыл бұрын
i love u... just wow ......
@Prashantkumar-pn6qq
@Prashantkumar-pn6qq 3 жыл бұрын
Wanna share some system design resources?
Binary Tree Cameras | Live Coding with Explanation | Leetcode - 968
13:15
Algorithms Made Easy
Рет қаралды 11 М.
Flatten Binary Tree to Linked List - Leetcode 114 - Python
14:27
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Chain Game Strong ⛓️
00:21
Anwar Jibawi
Рет қаралды 41 МЛН
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
L38. Flatten a Binary Tree to Linked List | 3 Approaches | C++ | Java
21:51
Understanding B-Trees: The Data Structure Behind Modern Databases
12:39
Jump Game II | Live Coding with Explanation | Leetcode - 45
9:38
Algorithms Made Easy
Рет қаралды 26 М.
Flatten Binary Tree to Linked List | Leetcode #114
15:43
Techdose
Рет қаралды 7 М.
LeetCode Flatten Binary Tree to Linked List Explained - Java
5:23
To Brawl AND BEYOND!
00:51
Brawl Stars
Рет қаралды 17 МЛН