int Count() const
Get the current number of target indices.
Definition: QuickUnion.h:84
std::vector< unsigned > m_id
Stores target index for each original index.
Definition: QuickUnion.h:62
bool Connected(unsigned p, unsigned q)
Whether two original indices are now connected.
Definition: QuickUnion.h:104
unsigned int Find(unsigned p)
Find the current target index for provided index p.
Definition: QuickUnion.h:91
QuickUnion class.
Definition: QuickUnion.h:19
void Unite(unsigned p, unsigned q)
Unite two indices.
Definition: QuickUnion.h:111
QuickUnion(const unsigned nBranches)
Constructor.
Definition: QuickUnion.h:69
int m_count
The current number of target indices.
Definition: QuickUnion.h:64