algos/pre_post_recursion.c
struct order* pre_post(struct node *adj[], int NV) {
	int k;
	int *visited;
	struct order* values;
	int count=1;
	values=(struct order*)malloc((NV+1)*sizeof(*values));
	visited=(int *)malloc((NV+1)*sizeof(int));
	//iterate over all nodes
	for(k=1;k<=NV;k++) {
		//if we haven't visited node yet, explore it
		if(visited[k]==0) {
			//explore all nodes connected to node k
			explore(k,visited,adj,values,&count);
		}
	}
	//we overcounted 
	return values;
}
//computes the number of connected components
computes the number of connected components
computes the number of connected components
struct order* pre_post(struct node *adj[], int NV) {
	int k;
	int *visited;
	struct order* values;
	int count=1;
	values=(struct order*)malloc((NV+1)*sizeof(*values));
	visited=(int *)malloc((NV+1)*sizeof(int));
	for(k=1;k<=NV;k++) {
		if(visited[k]==0) {
			explore(k,visited,adj,values,&count);
		}
	}
	return values;
}
struct order * pre_post ( struct node * adj [ ] , int NV ) { int k ; int * visited ; struct order * values ; int count = 1 ; values = ( struct order * ) malloc ( ( NV + 1 ) * sizeof ( * values ) ) ; visited = ( int * ) malloc ( ( NV + 1 ) * sizeof ( int ) ) ; for ( k = 1 ; k <= NV ; k ++ ) { if ( visited [ k ] == 0 ) { explore ( k , visited , adj , values , & count ) ; } } return values ; }
computes the number of connected components
computes the number of connected components
//iterate over all nodes //if we haven't visited node yet, explore it //explore all nodes connected to node k //we overcounted 