题目链接: https://cn.vjudge.net/problem/POJ-1724 N cities named with numbers 1 ... N are connected with one-way roads. Each road has two parameters associated with it : the road length and the toll that needs to be paid for the road (expressed in the num…
邻接矩阵实现如下: /* 主题:用邻接矩阵实现 DFS(递归) 与 BFS(非递归) 作者:Laugh 语言:C++ ******************************************* 样例输出如下: 请选择图的类型(a - 无向图, b - 有向图):a 请输入总顶点数,总边数:8 9 请依次输入点的信息:a b c d e f g h 输入一条边依附的顶点及权值 (eg: a b 6): a b 1 a c 1 b d 1 b e 1 d h 1 e h 1 c f 1…