|
Data Structures & Algorithms in C++
Goodrich, Tamassia, Mount and Goldwasser
|
#include <partition.h>

Data Structures | |
| class | Position |
Public Member Functions | |
| Position | make_cluster (T elem) |
| Adds the given element to the universe and returns its Position token. | |
| Position | find (Position p) |
| void | combine (Position p, Position q) |
| Combines the clusters containing elements indicated by p and q (if not already the same cluster) | |
A representation of a universe of elements organized into disjoint sets
This implementation uses a tree-based representation of sets with path compression during the find operation and performing union with union-by-size heuristic
|
inline |
Combines the clusters containing elements indicated by p and q (if not already the same cluster)

|
inline |
|
inline |
Adds the given element to the universe and returns its Position token.