Skip to content

UnionFind capacity management #731

@starovoid

Description

@starovoid

Summary

Add methods to reserve, obtain, and shrink UnionFind capacity.

Motivation

As mentioned in proposal #729, some algorithms can dynamically generate new elements during execution. And in cases where a certain bound of their number may become known during execution, it would be nice to immediately reserve the necessary capacity to avoid unnecessary re-allocations.

Progress

  • UnionFind::capacity
  • UnionFind::with_capacity()
  • UnionFind::reserve
  • UnionFind::reserve_exact
  • UnionFind::try_reserve
  • UnionFind::try_reserve_exact
  • UnionFind::shrink_to_fit
  • UnionFind::shrink_to

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions