随笔分类 - 数据结构-二叉树
摘要:题目连接http://acm.hdu.edu.cn/showproblem.php?pid=5444Elven PostmanDescriptionElves are very peculiar creatures. As we all know, they can live for a very ...
阅读全文
摘要:题目连接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...
阅读全文
摘要:原题链接: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...
阅读全文
摘要:原题链接: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...
阅读全文
摘要:原题链接: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...
阅读全文
摘要:原题链接:http://ac.jobdu.com/problem.php?pid=1523建树,再层次遍历bfs。为了找根方便些,加了father指针。。。如下: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 ...
阅读全文
摘要:原题链接: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 ...
阅读全文
摘要:原题链接: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...
阅读全文

浙公网安备 33010602011771号