mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 05:21:49 +03:00
Fix output display
This commit is contained in:
parent
1e9c4a5610
commit
5e8dbc06d0
@ -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++)
|
||||
printf("%d\t%d\n",i,dist[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
|
||||
|
@ -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++)
|
||||
printf("%d\t%d\n",i,dist[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
|
||||
|
Loading…
Reference in New Issue
Block a user