You are viewing a single comment's thread. Return to all comments →
Indeed.
The python one-liner:
def check_binary_search_tree_(root, left = float('-inf'), right = float('inf')): return not root or check_binary_search_tree_(root.left, left, root.data) and left < root.data < right and check_binary_search_tree_(root.right, root.data, right)
Seems like cookies are disabled on this browser, please enable them to open this website
Is This a Binary Search Tree?
You are viewing a single comment's thread. Return to all comments →
Indeed.
The python one-liner: