All pastes #187608 Raw Edit

Anonymous

public text v1 · immutable
·published 2006-10-01 08:48 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);
		   }
		}
	}
}