TTreeSentinel
Product

Product features · Strict binary-search-tree ordering

01

Review bst_order.py with inherited ancestor bounds so a locally ordered child cannot hide a global tree violation.

01

Connection

Base URL, credentials and a reachable server.

02

Selection

A model available through the configured endpoint.

03

Capabilities

Context limits and tool support are determined by the model and server.

Strict binary-search-tree ordering

● ● ●TreeSentinel●
A concrete starting point · Strict binary-search-tree ordering ×
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)
✳Strict binary-search-tree ordering
✓ ChangesReview before applying ↗
Illustrative workspace
AI coding workspace

Your next change starts here.

Get the Windows app ↗