Тёмный

1038. Binary Search Tree to Greater Sum Tree | Recursive | Iterative | Morris Traversal 

Aryan Mittal
Подписаться 45 тыс.
Просмотров 2,8 тыс.
50% 1

In this video, I'll talk about how to solve Leetcode 1038. Binary Search Tree to Greater Sum Tree | Recursive | Iterative | Morris Traversal - Super Important
Tree Traversal + Morris Traversal - • Video
Let's Connect:
📱Discord (Join Community) : / discord
📝Linkedin: / aryan-mittal-0077
📸 Instagram: / codewitharyanbhai
💻 Twitter - / aryan_mittal007
🤖 Github: github.com/aryan-0077
About Me:
I am Aryan Mittal - A Software Engineer in Goldman Sachs, Speaker, Creator & Educator. During my free time, I create programming education content on this channel & also how to use that to grow :)
✨ Timelines✨
0:00 - Problem Explanation
2:26 - Brute Force
3:54 - Approach1 - Recursive
8:37 - Approach2 - Iterative
17:56 - Approach3 - Morris Traversal
22:56 - Point by Point Explanation
33:43 - Summing Up
✨ Hashtags ✨
#programming #Interviews #leetcode #faang #maang #datastructures #algorithms

Опубликовано:

 

30 июл 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 15   
@youtubeuserlovesyoutube2207
@youtubeuserlovesyoutube2207 Месяц назад
thanks aryan GOAT
@mohammedansil2302
@mohammedansil2302 Месяц назад
Thanks clear explanation
@codebreaker6578
@codebreaker6578 Месяц назад
I can't believe myself that i done this problem without watching this video . Because it's my first tree problem ,I just saw GFG how to traverse tree and came up with solution which passed all testcase in single run with time complexity O(N) class Solution { public: int sum=0; void update(TreeNode* node){ if(node==nullptr){ return; } update(node->right); sum+=node->val; node->val=sum; update(node->left); } TreeNode* bstToGst(TreeNode* root) { update(root); return root; } };
@abhinay.k
@abhinay.k Месяц назад
nice
@insaneclutchesyt948
@insaneclutchesyt948 Месяц назад
u must be a genius
@codebreaker6578
@codebreaker6578 Месяц назад
@@insaneclutchesyt948 but didn't optimal approach
@cenacr007
@cenacr007 Месяц назад
@codebreaker6578
@codebreaker6578 Месяц назад
I didn't do any tree question till now should i do this ?
@insaneclutchesyt948
@insaneclutchesyt948 Месяц назад
my dumbass thought vertical order traversal to get the sum of all the right nodes
@codebreaker6578
@codebreaker6578 Месяц назад
can you please explain how recursive is using O(n) space , in itertative it's because of stack
@ajayprabhu465
@ajayprabhu465 Месяц назад
Function stack space takes O(n)
@ITACH1688
@ITACH1688 Месяц назад
recursive function calls are managed using call stack.
@codebreaker6578
@codebreaker6578 Месяц назад
@@ajayprabhu465 👍
@codebreaker6578
@codebreaker6578 Месяц назад
@@ITACH1688 👍
@lokesh8660
@lokesh8660 Месяц назад
waiting for today's dc in place modification approach 🥲
Далее
ЭТОТ ПЕНЁК ИЗ PLANTS VS ZOMBIES - ИМБА!
00:48
Чистка пляжа с золотом
00:49
Просмотров 276 тыс.
Convert BST to Greater Tree - Leetcode 538 - Python
9:33
8 patterns to solve 80% Leetcode problems
7:30
Просмотров 276 тыс.
The moment we stopped understanding AI [AlexNet]
17:38
Просмотров 808 тыс.