Easy
,Tree
,Binary Tree
,DFS
,Binary Search Tree
Given the root
node of a binary search tree and two integers low
and high
, return the sum of values of all nodes with a value in the inclusive range[low, high]
.
Example 1:
Example 2:
Constraints:
Node.val
<= 105low
<= high
<= 105Node.val
are unique.多寫一個非遞迴的版本
Marsgoat Dec 7, 2022
Kobe Dec 7, 2022
Jim Dec 7, 2022