摘要:
题目链接:http://poj.org/problem?id=1958 代码: #include<iostream> #include<cstring> using namespace std; #define maxn 100 typedef long long ll; ll d[maxn],f[ 阅读全文
摘要:
给定n个点的带权路径,求0到n-1的最短哈密顿通路,使用位运算以及动态规划的思想进行精确计算,实际上算法能处理的结点数量大约在20个,如果只需要获得 比较优的解可以通过神经网络、模拟退火等最优化理论的算法进行搜索。 代码如下: #include<iostream> #include<string.h 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1710 通过先序以及中序遍历建树并且输出后序遍历的结果。 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int u 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1527 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1848 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1846 代码: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; ty 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2067 #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; typede 阅读全文
摘要:
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1521 代码如下: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; 阅读全文
摘要:
dp: #include<bits/stdc++.h> using namespace std; typedef unsigned int ui; typedef long long ll; typedef unsigned long long ull; #define pf printf #def 阅读全文
摘要:
以下代码中显示了二叉树的链式存储以及先序遍历递归建树,后序遍历释放资源,复制一棵二叉树,先序、中序、后序遍历的递归以及非递归实现,求叶子结点数量的递归以及非递归函数,求非叶子结点的递归以及非递归函数。求深度的递归函数。 文件输入,文件中的内容是 1 2 4 0 0 5 6 0 0 0 3 7 0 0 阅读全文