Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int Diametro(Grafo G)
- {
- int i,j,min1=0,min2=0,min,resul;
- tCoste **A;
- vertice **P;
- Floyd(G,&A,&P);
- for(i=0;i<G->numVert;i++)
- {
- for(j=0;j<G->numVert;j++)
- {
- if(A[i][j]>min1)
- min1=A[i][j];
- }
- for(j=0;j<G->numVert;j++)
- {
- if(A[i][j]>min2 && A[i][j]<min1)
- min2=A[i][j];
- min=min1+min2;
- }
- if(min>resul)
- resul=0;
- }
- return resul;
- }
Advertisement
Add Comment
Please, Sign In to add comment