算法
reecefan
BIG
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
减枝方法论和旅行商问题
简单分析一下上述方案的合理性:首先,将解集划分为包含某一条边和不包含某一条边的两个子集,不会有情况漏掉;其次每次都更新矩阵,进行1)中的处理,这样保证每次都能找到满足划分条件的边;最后,采用2)中的条件选择边,是的左子节点下界增加的小,而右子节点的增加的大,这样利用爬山策略,可以很快的找到可能解的代价,而且这个代价还是比较小的,对于右子节点代价增加的比较大,可以在很早的阶段进行剪枝,提高效率。原创 2016-05-11 15:36:09 · 676 阅读 · 0 评论 -
经典分解质因数算法
#include #include #include int main() { int n,i; scanf("%d",&n); printf("%d=",n); for(i=2;i { if(n%i==0) {原创 2016-09-10 22:40:29 · 4770 阅读 · 0 评论 -
c++pp7.13.3
#include using namespace std; struct box{ char maker[40]; float height; float width; float length; float volume; }; void show(box b); void addr(box *); int main(){ box B; B = { "DIAO",原创 2017-02-27 22:07:27 · 384 阅读 · 0 评论 -
醉了,第一个递归函数---阶乘
#include using namespace std; long double jieCheng(double n); int main(){ double n; long double result; cin >> n; result = jieCheng(n); cout system("PAUSE"); return 0; } long double jieCh原创 2017-02-28 10:08:28 · 272 阅读 · 0 评论 -
c++pp7.13.7
#include using namespace std; int* Fill_array(int *, int *); void Show_array(int *, int *); #define max 10 int golf[max]; int main(){ int* size; size = Fill_array(golf, golf+ma原创 2017-02-28 14:54:34 · 313 阅读 · 0 评论 -
c++pp 7.13.2
#include using namespace std; int input(double *, int); void show(const double *, int); double mean(const double *, int); const int max = 3; int main(){ double golf[max]; double amean; int si原创 2017-02-27 17:56:10 · 355 阅读 · 0 评论
分享