Range Sum of BST (LeetCode 938) | Full solution with animations and examples | Study Algorithms

preview_player
Показать описание
You are given a binary search tree and a range of values. The problem requires you to find the sum of all the elements present in the tree inclusive of the range low and high. This video explores how you can approach this problem and take advantage of the fact that this is a binary search tree. All left nodes will have a value lesser than the parent, and all right nodes will have a value higher than the parent. Watch the video see a nice explanation along with the dry-rin of code in JAVA.

Chapters:
00:00 - Intro
01:20 - Problem statement and description
03:29 - Brute Force approach to find range sum of BST
05:52 - Find the range sum of BST efficiently
08:40 - Dry-run of code
12:33 - Final Thoughts

📚 Links to topics I talk about in the video:

📖 Reference Books:

🎥 My Recording Gear:

💻 Get Social 💻

#leetcode #programming #binarytree
Рекомендации по теме
Комментарии
Автор

the way of explanation is just wow sir

vaddibharath
Автор

doesn' the sum should be a global variable? doesn't it reset every time you make a recursive call?can you please explain me?

priyakolluru
Автор

you are so stunning do not stop please 🥰😍😍

MoreMono-xu
join shbcf.ru