时间复杂度(O(n)), 搜索二叉树树的遍历
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = Noneclass Solution:def rangeSumBST(self, root: TreeNode, L: int, R: int) -> int:if root is None: return 0if root.val < L: return self.rangeSumBST(root.right, L, R)if root.val > R: return self.rangeSumBST(root.left, L, R)return root.val + self.rangeSumBST(root.left, L, R) + self.rangeSumBST(root.right, L, R)