DisjointSets

cats.collections.DisjointSets
See theDisjointSets companion object
class DisjointSets[T]

Attributes

Companion:
object
Source:
DisjointSets.scala
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def +(v: T): DisjointSets[T]

Add a value to this datastructure

Add a value to this datastructure

Attributes

v

Value to be added

Returns:

New DisjointSets 's state.

Source:
DisjointSets.scala
def contains(v: T): Boolean

Checks whether or not a value is present in the disjoint sets collection

Checks whether or not a value is present in the disjoint sets collection

Attributes

v

label to be found within the data structure

Returns:

Check result

Source:
DisjointSets.scala
def find(v: T): (DisjointSets[T], Option[T])

Find the label of the provided value.

Find the label of the provided value.

Attributes

v

Value whose label is to be found

Returns:

(new state, 'None' if the value doesn't exist, Some(label) otherwise)

Source:
DisjointSets.scala
def toSets: (DisjointSets[T], AvlMap[T, AvlSet[T]])

Generates a map from labels to sets from the current DisjointSets.

Generates a map from labels to sets from the current DisjointSets.

Attributes

Source:
DisjointSets.scala
def union(a: T, b: T): (DisjointSets[T], Boolean)

Joins two disjoint sets if both are contained by this DisjointSets

Joins two disjoint sets if both are contained by this DisjointSets

Attributes

a

Set a

b

Set b

Returns:

(new DisjointSets with updated state, true if Both labels are contained and joined )

Source:
DisjointSets.scala