E
- public static class Graph.DisjointSet<E>
extends java.lang.Object
DisjointSet
class.
This is a simple implementation of a disjoint set data structure
for use in the minimal spanning tree algorithm of the
Graph
class.
The structure is esentially a LinkedList of LinkedLists. Constructor and Description |
---|
Graph.DisjointSet()
This is the constructor for
DisjointSet objects. |
Modifier and Type | Method and Description |
---|---|
java.util.LinkedList<E> |
find(E element)
This returns the LinkedList in the list of LinkedLists that
contains the element specified, or null if none of the lists
contain the element.
|
void |
makeSet(E singleton)
This creates a new LinkedList that contains the one object that
is the parameter, and adds it to the list of LinkedLists.
|
void |
union(E a,
E b)
This method takes the list containing b and appends it to the list
containing a.
|
public Graph.DisjointSet()
DisjointSet
objects.public void makeSet(E singleton)
singleton
- the single data member that will make up the new
LinkedList.public void union(E a, E b)
a
- the member whose list will get b's list appended to it.b
- the member whose list will be appended to a's list.