You are viewing a single comment's thread. Return to all comments →
def inorder_list(root): values = [] def inorder_t(root): if root is None: return inorder_t(root.left) values.append(root.data) inorder_t(root.right) inorder_t(root) return values def check_binary_search_tree_(root): if root is None: return values = inorder_list(root) if values == sorted(values) and len(values) == len(set(values)): return True else: return False
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 →