All pastes #187610 Raw Edit

Untitled

public text v1 · immutable
·published 2006-10-01 08:49 UTC
rendered paste body
void isConnected (Graph graph, int curCity, int secondCity, int curDepth){

   if ((curCity == secondCity) ||
	(graph[curCity].firstRoadLink->city == secondCity)){
	   printf("They are connected !\n");
	}else{

           Link curLink = graph[curCity].firstRoadLink;
	      if (curLink != NULL){
	         while (curLink->nextCitybyRoad != NULL){
                    curLink = curLink->nextCitybyRoad;
                    printf("curDepth = %d\n", curDepth);
	            isConnected(graph, curLink->city, secondCity, ++curDepth);
		 }
	      }
	}
}