Fix output display

This commit is contained in:
arpanjain97 2017-10-13 11:53:03 +05:30
parent 1e9c4a5610
commit 5e8dbc06d0
2 changed files with 12 additions and 4 deletions

View File

@ -48,8 +48,12 @@ int minDistance(int mdist[], int vset[], int V){
//Utility function to print distances
void print(int dist[], int V){
printf("\nVertex Distance\n");
for(int i = 0; i < V; i++)
for(int i = 0; i < V; i++){
if(dist[i] != INT_MAX)
printf("%d\t%d\n",i,dist[i]);
else
printf("%d\tINF",i);
}
}
//The main function that finds the shortest path from given source

View File

@ -43,8 +43,12 @@ int minDistance(int mdist[], int vset[], int V){
//Utility function to print distances
void print(int dist[], int V){
printf("\nVertex Distance\n");
for(int i = 0; i < V; i++)
for(int i = 0; i < V; i++){
if(dist[i] != INT_MAX)
printf("%d\t%d\n",i,dist[i]);
else
printf("%d\tINF",i);
}
}
//The main function that finds the shortest path from given source