cgv
Loading...
Searching...
No Matches
cgv::data::union_find Struct Reference
Inheritance diagram for cgv::data::union_find:

Public Member Functions

 union_find (unsigned int n)
 construct with given number of elements
 
void init (unsigned int n)
 init such that each element is a representative
 
unsigned int find (unsigned int i)
 find representative with path compression
 
void unify (unsigned int i, unsigned int j)
 union of two groups
 

Detailed Description

Definition at line 8 of file union_find.h.

Constructor & Destructor Documentation

◆ union_find()

cgv::data::union_find::union_find ( unsigned int  n)
inline

construct with given number of elements

Definition at line 11 of file union_find.h.

References init().

Member Function Documentation

◆ find()

unsigned int cgv::data::union_find::find ( unsigned int  i)
inline

find representative with path compression

Definition at line 19 of file union_find.h.

Referenced by unify().

◆ init()

void cgv::data::union_find::init ( unsigned int  n)
inline

init such that each element is a representative

Definition at line 13 of file union_find.h.

Referenced by union_find().

◆ unify()

void cgv::data::union_find::unify ( unsigned int  i,
unsigned int  j 
)
inline

union of two groups

Definition at line 34 of file union_find.h.

References find().


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