equal
deleted
inserted
replaced
1 // -*- c++ -*- // |
1 // -*- c++ -*- // |
2 #ifndef UNION_FIND_H |
2 #ifndef HUGO_UNION_FIND_H |
3 #define UNION_FIND_H |
3 #define HUGO_UNION_FIND_H |
4 |
4 |
5 #include <vector> |
5 #include <vector> |
6 #include <utility> |
6 #include <utility> |
7 |
7 |
8 namespace hugo { |
8 namespace hugo { |
66 data[cb].second += data[ca].second; |
66 data[cb].second += data[ca].second; |
67 } |
67 } |
68 return true; |
68 return true; |
69 } |
69 } |
70 |
70 |
|
71 int componentSize(T a) |
|
72 { |
|
73 int ca = whichComponent(a); |
|
74 return data[ca].second; |
|
75 } |
|
76 |
71 }; |
77 }; |
72 |
78 |
73 } //namespace hugo |
79 } //namespace hugo |
74 |
80 |
75 #endif //UNION_FIND_H |
81 #endif //HUGO_UNION_FIND_H |