在二叉排序树(Binary Search Tree, BST)中,假设节点值互不相同。给定如下搜索函数,以下说法 一定正
确的是( )。
class Node: def __init__(self, val=0, left=None, right=None): self.val = val self.left = left self.right = right def find(root, x): while root: if root.val == x: return True if x < root.val: root = root.left else: root = root.right return False