Enum treap_map::SearchResult
source · pub enum SearchResult<'a, C: TreapMapConfig, W: ConsoliableWeight> {
Abort,
LeftMost,
Found {
base_weight: W,
node: &'a Node<C>,
},
RightMost(W),
}
Expand description
Represents the possible outcomes of the accumulate_weight_search
.
This enum encapsulates the results that can be returned by
accumulate_weight_search
, indicating the outcome of the search within a
treap map.
Variants§
Abort
Indicates that the search was aborted. This variant is used when no feasible result is found and the search position is neither at the extreme left nor the extreme right of the treap.
LeftMost
Indicates that the search reached the leftmost edge of the entire treap without finding a feasible result.
Found
Represents a successful search, indicating a feasible result has been
found. Contains base_weight
, which is the total weight from the
leftmost edge up to but not including the current node,
and a reference to the node
itself.
RightMost(W)
Indicates that the search reached the rightmost edge of the entire
treap without finding a feasible result. Also returns the total
weight of the entire tree (RightMost(W)
).