Struct_graph&practice_190705

Example of graph

  • skill:

figure min value:tag设为无穷,小则不断更新
figure max value:tag设极小值,大则不断更新
how to judge if there are a negative value circle
Struct_graph&practice_190705
Struct_graph&practice_190705
analysis

  • 对给定网图,floyd求任意两点间shortest path
  • array max_row中取min
  • 邻接矩阵表示图–floyd

Struct_graph&practice_190705
Struct_graph&practice_190705
Struct_graph&practice_190705
Struct_graph&practice_190705
Struct_graph&practice_190705
Struct_graph&practice_190705

图的顶点从0开始编号,而本题目中动物从1开始编号。读输入时
E->V1–; E->V2–;
Struct_graph&practice_190705
Struct_graph&practice_190705

上一篇:java小练习practice


下一篇:PAT (Basic Level) Practice (中文)1006 换个格式输出整数 (15 分)