Documentation

Complexity.Algorithms.Lean.SearchTree.Cost

Search-tree node-visit costs #

The cost model counts visits to internal nodes. Empty-child tests, allocation, reconstruction, order-comparison implementation, and pure client computation are not charged. In particular, inserting into an empty tree costs zero in this model. These are not RAM instruction counts.

Each traversal below follows exactly the branch decisions of its corresponding operation. Search and insertion follow the same path; minimum follows left children; successor follows one child and retains a candidate when descending left. No operation scans both subtrees.

Main definitions #

Main results #

References #

Internal-node visits shared by membership and insertion.

Instances For

    Internal-node visits of leftmost descent.

    Instances For

      Internal-node visits of strict successor, including failed searches.

      Instances For

        This permits linear height growth; it is not a balancing theorem.