LeetCode | 1038 Binary Search Tree to Greater Sum Tree

preview_player
Показать описание
Hey, I'm back with a new video after a short hiatus. I'll be making plenty of videos over the next few weeks.

We are going to be tackling this question with a recursive approach. Sorry if my explanation is confusing, its been a while.

Space Complexity: O(N) where N is the number of nodes on the tree. We have to hold on to potentially all of them if it is a completely unbalanced tree for our recursive call stack (I.E all right side or all left side nodes).

Time Complexity: O(N) - We must visit every node of the tree.
Рекомендации по теме
Комментарии
Автор

Sorry for the hiatus! Good news, we have a child on the way and I got a FAANG job offer.

Let me know if you want me to create a video on my coding journey, how I prepared for my interviews, or anything else. I just want to help people as much as I can.

I will be doing a LC daily problem video each day, so stick around for those.

webidiots
welcome to shbcf.ru