随笔分类 -  二叉树

 
HDU 1710
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1710题意:给二叉树的先序遍历和中序遍历,确定后序遍历解法:复习专业课找的一题,根据先序遍历和中序遍历建树,再对树做后序遍历#include #include using namespace std;struct ... 阅读全文
posted @ 2015-11-28 22:34 LegendaryAC 阅读(244) 评论(0) 推荐(0)
HDU 1622
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1622白书上6.3.2二叉树层次遍历的例题,层次遍历用bfs,建立二叉树,很基础的题目#include #include #include #include #include using namespace std... 阅读全文
posted @ 2014-11-23 11:58 LegendaryAC 阅读(338) 评论(0) 推荐(0)
HDU 3791
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3791建立二叉树,对比是否相同#include #include #include using namespace std;#define lson rt<<1#define rson rt<<1|1int tre... 阅读全文
posted @ 2014-11-05 17:02 LegendaryAC 阅读(363) 评论(0) 推荐(0)