紫书:P155 uva 548 You are to determine the value of the leaf node in a given binary tree that is the terminal node of a path of least value from the root of the binary tree to any leaf. The value of a path is the sum of values of nodes along that path
对如下图进行广度和深度遍历; dfs遍历,(依次输出遍历顶点): 用邻接矩阵存图(用一个二维数组把图存起来)! <span style="font-size:18px;">#include<stdio.h> #define MAX 9999999//当顶点之间不相通时,标记为一个很大的数 int sum=0;//记录遍历的顶点的个数 int v,s;//顶点数和边数 int book[50]={0},p[30][30];//标记数组和矩阵 void dfs(in