Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 503 Bytes
""" Node is defined as
class node:
def __init__(self, data): = data
self.left = None
self.right = None
def check(root, min, max):
if root == None:
return True
if <= min or max <=
return False
return check(root.left, min, and check(root.right,, max)
def checkBST(root):
return check(root, float('-inf'), float('inf'))