-
Notifications
You must be signed in to change notification settings - Fork 441
Closed
Description
Summary
Add a UnionFind::insert(&mut self) -> K method that adds a new element, in its own disjoint set.
Motivation
UnionFind currently requires the number of elements to be set during initialization. Some algorithms may dynamically generate new items at runtime, so they would benefit from having such function (instead of over-allocating to some maximum element count if any).
We could optionally add with_capacity/len/is_empty too.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels