X周

导航

2013年6月19日 #

求数组的最大子数组

摘要: 求数组的最大和子数组是经典问题,许多书籍都提到,比如算法导论,编程珠玑。更是覆盖很多面试书,比如编程之美,剑指Offer等。以下是我关于该问题的理解与实现。 1 #include<iostream> 2 #include<cstdlib> 3 #include<climits> 4 using namespace std; 5 6 class SubArray{ 7 private: 8 int left; 9 int right; 10 int sum; 11 public: 12 void set(int l,int r,int s... 阅读全文

posted @ 2013-06-19 17:17 X周 阅读(240) 评论(0) 推荐(0)