Documentation

CslibFrontier.DataStructure.OrderedSet.ExtractMin

Minimum extraction through the shared ordered-set interface #

The client extractMin queries the minimum and, when one exists, deletes that observed key. Its semantics and chosen operation history are independent of a representation. Execution and resource guarantees come from the realization used by the caller; pure client computation has no machine-time claim here.

Main definitions #

Main results #

Return and remove the least key, or return none without deletion when the set is empty.

The deletion argument and operation history depend on the observed minimum.

@[simp]

Extraction returns the minimum of the original set.

The result has the complete optional-minimum contract, including empty-set detection.

When extraction returns a key, its final state removes exactly that key.

Exactly one element is removed from a nonempty set; an empty set stays empty.