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 #
extractMin: an adaptive minimum-and-deletion client.
Main results #
extractMin_run: the complete result, final set and answer-dependent operation history.extractMin_spec,extractMin_state_of_some: the returned minimum and its removal.extractMin_card: extraction reduces cardinality by one, with natural subtraction at zero.
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.
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.