/* ECP: FILEname=fig11_5.c */ /* 1*/ /* PrintPath Is A Driver; PrintPath1 Does The Real Work */ /* 2*/ static void /* 3*/ PrintPath1( int DestNode, const Vertex Graph[ ] ) /* 4*/ { /* 5*/ if( Graph[ DestNode ].PreviousNode != -1 ) /* 6*/ { /* 7*/ PrintPath1( Graph[ DestNode ].PreviousNode, Graph ); /* 8*/ printf( " to " ); /* 9*/ } /*10*/ printf( "%s", Graph[ DestNode ].NodeName ); /*11*/ } /* 1*/ void /* 2*/ PrintPath( int DestNode, const Vertex Graph[ ] ) /* 3*/ { /* 4*/ if( Graph[ DestNode ].Distance == Infinity ) /* 5*/ printf( "%s unreachable", Graph[ DestNode ].NodeName ); /* 6*/ else /* 7*/ PrintPath1( DestNode, Graph ); /* 8*/ printf( "\n" ); /* 9*/ }