code: public void findAllCC() {
  		if (nodeCC == null) {
  			CCFirstNode = new int[n];
  			CCNextNode = new int[n];
  			nodeCC = new int[n];
  			sizeCC = new int[n];
  		}
  		sizeMinCC = 0;
  		sizeMaxCC = 0;
  		ISet act = graph.getNodes();
  		for (int i : act) {
  			p[i] = -1;
  		}
  		for (int i = 0; i < CCFirstNode.length; i++) {
  			CCFirstNode[i] = -1;
  			sizeCC[i] = -1;
  		}
  		int cc = 0;
  		for (int i : act) {
  			if (p[i] == -1) {
  				findCC(i, cc);
  				if (sizeMinCC == 0 || sizeMinCC > sizeCC[cc]) {
  					sizeMinCC = sizeCC[cc];
  				}
  				if (sizeMaxCC < sizeCC[cc]) {
  					sizeMaxCC = sizeCC[cc];
  				}
  				cc++;
  			}
  		}
  		nbCC = cc;
  	}
docs: Find all connected components of graph by performing one dfs
  Complexity : O(M+N) light and fast in practice