Connection
Base URL, credentials and a reachable server.
Review bst_order.py with inherited ancestor bounds so a locally ordered child cannot hide a global tree violation.
Base URL, credentials and a reachable server.
A model available through the configured endpoint.
Context limits and tool support are determined by the model and server.
def is_strict_bst(root):
pending, seen, checks = [(root, None, None)], set(), []
while pending:
node, low, high = pending.pop()
if node is None:
continue
if type(node) is not list or len(node) != 3 or type(node[0]) is not int:
raise ValueError("tree.node")
if id(node) in seen or len(seen) == 1000:
raise ValueError("tree.structure")
seen.add(id(node))
value, left, right = node
checks.append((value, low, high))
pending.extend([(right, value, high), (left, low, value)])
return all((low is None or low < value) and
(high is None or value < high) for value, low, high in checks)