class UnionFind[D] extends Cloneable
A simple, textbook implementation of a union-find data structure.
Linear Supertypes
Ordering
- Alphabetic
- By Inheritance
Inherited
- UnionFind
- Cloneable
- AnyRef
- Any
- Hide All
- Show All
Visibility
- Public
- Protected
Instance Constructors
- new UnionFind()
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- def apply(d: D): D
Find the representing element for
d
.Find the representing element for
d
. Two elements belong to the same set iff they have the same representative. - final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): UnionFind[D]
- Definition Classes
- UnionFind → AnyRef
- def contains(d: D): Boolean
Check whether an element is already present in the forest.
- def elements: Iterator[D]
Iterator over all elements of this forest.
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def makeSet(d: D): Unit
Add a new element to the forest.
- def makeSetIfNew(d: D): Unit
Add a new element to the forest; the operation has no effect if the element is already present in the forest.
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @HotSpotIntrinsicCandidate() @native()
- def representatives: Iterator[D]
Iterator over the elements representing sets; exactly one object will be enumerated for each set.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- UnionFind → AnyRef → Any
- def union(d: D, e: D): Unit
Join two sets.
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)