case class ParentSize[V](parent: Option[V], size: Int)
Carries an optional parent reference and the size of the component tree.
Type parameters
V
the underlying object type.
Value parameters
parent
None if this object is a root; Some(p) otherwise.
size
the number of objects in this component tree (meaningful only at the root). With path compression active, this becomes an upper bound on depth (rank) rather than the precise tree size.
Creates a new instance of ParentSize with an updated size.
Creates a new instance of ParentSize with an updated size.
Value parameters
s
The new size of the component tree. This value represents either the number of objects in the tree (if at the root) or an upper bound on the tree's depth (rank) when path compression is active.
Attributes
Returns
A new ParentSize[V] instance with the updated size.