树的遍历 重建
acm160920007
这个作者很懒,什么都没留下…
展开
-
最小生成树
#include using namespace std; static const int MAX=100; static const int INFTY=(1 static const int WHITE=0; static const int GRAY=1; static const int BLACK=2; int n,M[MAX][MAX]; int prim() {原创 2017-08-08 16:57:28 · 205 阅读 · 0 评论 -
树的重建
#include #include #include #include using namespace std; vector pre,in,post; int n,pos; void rec(int l,int r) { if (l>=r) return ; int root=pre[pos++];原创 2017-07-27 15:51:06 · 237 阅读 · 0 评论