随笔分类 -  数据结构-二叉树

摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5444Elven PostmanDescriptionElves are very peculiar creatures. As we all know, they can live for a very ... 阅读全文
posted @ 2015-09-16 21:11 GadyPu 阅读(211) 评论(0) 推荐(0)
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=3999The order of a TreeDescriptionAs we know,the shape of a binary search tree is greatly related to the... 阅读全文
posted @ 2015-06-12 23:21 GadyPu 阅读(198) 评论(0) 推荐(0)
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1521水题,如下。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std::cin; 8 usi... 阅读全文
posted @ 2015-05-27 22:08 GadyPu 阅读(179) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hdu.edu.cn/showproblem.php?pid=1622小白书上的题。。。 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using std::queue; 8 u... 阅读全文
posted @ 2015-05-18 20:36 GadyPu 阅读(235) 评论(0) 推荐(0)
摘要:原题链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=20911简单题如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 using... 阅读全文
posted @ 2015-05-05 16:56 GadyPu 阅读(221) 评论(0) 推荐(0)
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1523建树,再层次遍历bfs。为了找根方便些,加了father指针。。。如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 ... 阅读全文
posted @ 2015-05-04 21:35 GadyPu 阅读(145) 评论(0) 推荐(0)
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1541简答题如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 const int Max_N = 1100; 7 struct Node{ 8 ... 阅读全文
posted @ 2015-05-04 21:32 GadyPu 阅读(155) 评论(0) 推荐(0)
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1184简单的二叉树重建,遍历.如下: 1 #include 2 #include 3 #include 4 #include 5 struct node{ 6 char key; 7 node *ch... 阅读全文
posted @ 2015-05-04 21:25 GadyPu 阅读(245) 评论(0) 推荐(0)