摘要: 可直接编译运行,其中status()方法效果如图: 阅读全文
posted @ 2016-08-30 14:15 backinfile 阅读(1777) 评论(0) 推荐(0) 编辑
摘要: 分治策略的思路: 1.将问题分解为一些子问题,其中有的子问题的形式与原问题相同,只是规模更小 2.递归,求解使递归停止的边界条件 3.合并 对于最大子数组问题, 阅读全文
posted @ 2016-08-30 13:28 backinfile 阅读(238) 评论(0) 推荐(0) 编辑
摘要: 可直接编译运行,其中方法status为形象的显示出栈的结构: 1 // visual stack , need define "cout 4 using std::cout; 5 6 template 7 struct item 8 { 9 item():value(),last(NULL),next(NULL){} 10 item *las... 阅读全文
posted @ 2016-08-30 01:14 backinfile 阅读(319) 评论(0) 推荐(0) 编辑