code: private int parent(BitSet ancestors, int curr) {
          curr = dsf.getRoot(curr);
          ancestors.set(curr);
          int parent = dsf.getRoot(even[curr]);
          if (parent == curr) return curr; // root of tree
          ancestors.set(parent);
          return dsf.getRoot(odd[parent]);
      }
docs: Access the next ancestor in a tree of the forest. Note we go back two
  places at once as we only need check 'even' vertices.
  
  @param ancestors temporary set which fills up the path we traversed
  @param curr      the current even vertex in the tree
  @return the next 'even' vertex