mirror of
https://github.com/TheAlgorithms/C
synced 2024-11-22 13:31:21 +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
|
//Utility function to print distances
|
||||||
void print(int dist[], int V){
|
void print(int dist[], int V){
|
||||||
printf("\nVertex Distance\n");
|
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]);
|
printf("%d\t%d\n",i,dist[i]);
|
||||||
|
else
|
||||||
|
printf("%d\tINF",i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//The main function that finds the shortest path from given source
|
//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
|
//Utility function to print distances
|
||||||
void print(int dist[], int V){
|
void print(int dist[], int V){
|
||||||
printf("\nVertex Distance\n");
|
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]);
|
printf("%d\t%d\n",i,dist[i]);
|
||||||
|
else
|
||||||
|
printf("%d\tINF",i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//The main function that finds the shortest path from given source
|
//The main function that finds the shortest path from given source
|
||||||
|
Loading…
Reference in New Issue
Block a user