Binary Search Tree Operations: Trimming, Array Conversion, and Greater Sum Tree
Trimming a Binary Search Tree (LeetCode 669) The algorithm removes all nodes not within the range [low, high]. The key insight is the nested recursion: when the current node's value is outside the range, one entire subtree can be discarded, but the other subtree may still contain out-of-range nodes...