Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
graph_oracles::Union_Find Struct Reference

Union-find over the nodes 0 .. n - 1. More...

#include <graph_oracles.H>

Collaboration diagram for graph_oracles::Union_Find:
[legend]

Public Member Functions

 Union_Find (int n)
 
int find (int x)
 
bool join (int a, int b)
 Joins the sets of a and b; false if they were the same set.
 

Public Attributes

std::vector< int > parent
 

Detailed Description

Union-find over the nodes 0 .. n - 1.

Definition at line 61 of file graph_oracles.H.

Constructor & Destructor Documentation

◆ Union_Find()

graph_oracles::Union_Find::Union_Find ( int  n)
inlineexplicit

Definition at line 65 of file graph_oracles.H.

References parent.

Member Function Documentation

◆ find()

int graph_oracles::Union_Find::find ( int  x)
inline

Definition at line 70 of file graph_oracles.H.

References parent.

Referenced by graph_oracles::component_of(), graph_oracles::euler_class(), and join().

◆ join()

bool graph_oracles::Union_Find::join ( int  a,
int  b 
)
inline

Joins the sets of a and b; false if they were the same set.

Definition at line 78 of file graph_oracles.H.

References find(), and parent.

Referenced by graph_oracles::component_of(), graph_oracles::euler_class(), graph_oracles::has_cycle(), and graph_oracles::min_spanning_forest_weight().

Member Data Documentation

◆ parent

std::vector<int> graph_oracles::Union_Find::parent

Definition at line 63 of file graph_oracles.H.

Referenced by Union_Find(), find(), and join().


The documentation for this struct was generated from the following file: