algos/pre_post_recursion.c
void explore(int V, int* visited, struct node *adj[],struct order *vals,int *count) {
	struct node *t;
	//state what connected component the node is in
	visited[V]=1;
	vals[V].pre=*count;
	(*count)++;
	//visit all nodes connected to node V
	for(t=adj[V];t!=t->next;t=t->next) {
		if(visited[t->V]==0) {
			explore(t->V,visited,adj,vals,count);
		}
	}	
	vals[V].post=*count;
	(*count)++;
}
//explore all the nodes connected to node V using a recursive-DFS
explore all the nodes connected to node V using a recursive-DFS
explore all the nodes connected to node V using a recursive - DFS
void explore(int V, int* visited, struct node *adj[],struct order *vals,int *count) {
	struct node *t;
	visited[V]=1;
	vals[V].pre=*count;
	(*count)++;
	for(t=adj[V];t!=t->next;t=t->next) {
		if(visited[t->V]==0) {
			explore(t->V,visited,adj,vals,count);
		}
	}	
	vals[V].post=*count;
	(*count)++;
}
void explore ( int V , int * visited , struct node * adj [ ] , struct order * vals , int * count ) { struct node * t ; visited [ V ] = 1 ; vals [ V ] . pre = * count ; ( * count ) ++ ; for ( t = adj [ V ] ; t != t -> next ; t = t -> next ) { if ( visited [ t -> V ] == 0 ) { explore ( t -> V , visited , adj , vals , count ) ; } } vals [ V ] . post = * count ; ( * count ) ++ ; }
explore all the nodes connected to node V using a recursive-DFS
explore all the nodes connected to node V using a recursive - DFS
//state what connected component the node is in //visit all nodes connected to node V