Example #1
0
File: ST.C Project: eholk/pbbs
 bool reserve(intT i) {
   u = UF.find(E[i].u);
   v = UF.find(E[i].v);
   if (u != v) {
     R[u].reserve(i);
     R[v].reserve(i);
     return 1;
   } else return 0;
 }
Example #2
0
File: ST.C Project: eholk/pbbs
 bool reserve(intT i) {
   u = UF.find(E[i].u);
   v = UF.find(E[i].v);
   if (u > v) {intT tmp = u; u = v; v = tmp;}
   if (u != v) {
     R[v].reserve(i);
     return 1;
   } else return 0;
 }
Example #3
0
 bool reserve(int i) {
   u = UF.find(E[i].u);
   v = UF.find(E[i].v);
   if (u != v) {
     reserveLoc(R[u], i);
     reserveLoc(R[v], i);
     return 1;
   } else return 0;
 }