alonsosjumper

Pseudocentro

Jun 12th, 2011
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. int Diametro(Grafo G)
  2. {
  3. int i,j,min1=0,min2=0,min,resul;
  4. tCoste **A;
  5. vertice **P;
  6.  
  7. Floyd(G,&A,&P);
  8.  
  9. for(i=0;i<G->numVert;i++)
  10. {
  11. for(j=0;j<G->numVert;j++)
  12. {
  13. if(A[i][j]>min1)
  14. min1=A[i][j];
  15. }
  16. for(j=0;j<G->numVert;j++)
  17. {
  18. if(A[i][j]>min2 && A[i][j]<min1)
  19. min2=A[i][j];
  20. min=min1+min2;
  21. }
  22. if(min>resul)
  23. resul=0;
  24. }
  25. return resul;
  26. }
Advertisement
Add Comment
Please, Sign In to add comment