COMBINATORIAL_BLAS 1.6
 
Loading...
Searching...
No Matches
DisjSets.h
Go to the documentation of this file.
1#ifndef DISJ_SETS_H
2#define DISJ_SETS_H
3
4// DisjSets class
5//
6// CONSTRUCTION: with int representing initial number of sets
7//
8// ******************PUBLIC OPERATIONS*********************
9// void union( root1, root2 ) --> Merge two sets
10// int find( x ) --> Return set containing x
11// ******************ERRORS********************************
12// No error checking is performed
13
14#include <vector>
15using namespace std;
16
23{
24 public:
25 explicit DisjSets( int numElements );
26
27 int find( int x ) const;
28 int find( int x );
29 void unionSets( int root1, int root2 );
30
31 private:
32 vector<int> s;
33};
34
35#include "DisjSets.cpp"
36#endif
int find(int x) const
Definition DisjSets.cpp:36
void unionSets(int root1, int root2)
Definition DisjSets.cpp:18