Skip to content

BST [mp]

Micro pattern

Description

Exploit the invariant that left-subtree keys are smaller and right-subtree keys are larger than the current key.

Problems

Ordered search and maintenance

Use key comparisons to choose a subtree and maintain its ordering.

Validate ordering

Propagate strict ancestor bounds or check increasing inorder values.

Construct or enumerate in sorted order

Select ordered roots or traverse keys in ascending order.