Beispiel #1
0
void randomClusterGraph(ClusterGraph &C,Graph &G,int cNum)
{
	int n = G.numberOfNodes();
	//int m = G.numberOfEdges();

	node v;
	int count = 0;
	NodeArray<int> num(G);
	Array<node> numNode(0,n-1,0);
	forall_nodes(v,G)
	{
		num[v] =  count;
		numNode[count] = v;
		count++;
	}
Beispiel #2
0
  // finding the number of nodes in a tree
int numNode (TreeNodePtr root){
	if(root == NULL) return 0;
	return 1 + numNode(root->leftPtr) + numNode(root->rightPtr);
}