Problem: Range Sum of BST
Understand how to solve the problem of finding the sum of all node values in a binary search tree that fall within a specified range. This lesson teaches you to use the BST properties to efficiently prune unnecessary subtrees and implement a recursive solution in C# that balances time and space complexity.
We'll cover the following...
We'll cover the following...
Statement
You are given the root of a binary search tree (BST) along with two integers low and high. Compute and return the sum of all node values that fall within the inclusive range [low, high].
Note: All node values in the BST are unique.
Constraints:
The number of nodes in the tree is in the range
. ...