c++树
cvb00052
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
codevs 1501二叉树最大宽度和高度
地址:http://codevs.cn/problem/1501/第一次接触树。幸好这题的节点都是一定的,不是随便定下来的。(其实上网查了题解才知道理解错题意了。。)所以用深搜来做不用想这么多。不然我暂时也做不了。#include using namespace std;int width[10], tree[20][2];int layernum,原创 2016-07-30 20:12:45 · 431 阅读 · 0 评论 -
codevs 3143 二叉树的序遍历
地址:http://codevs.cn/problem/3143/题目规定了树的每个位置的编号,所以可以直接用这个编号来遍历。#include using namespace std;int tree[200][2];void preorder(int i) { if(tree[i][0] != 0) { cout << tree[i][0] << "原创 2016-07-30 20:17:21 · 432 阅读 · 0 评论
分享