摘要: 1. 最大子序列和问题int MaxSubsquenceSum(const int A[],int N){ int ThisSum,MaxSum,j; ThisSum = MaxSum = 0; for(j=0;j<N;j++){ ThisSum += A[j]; if(ThisSum > MaxSum) MaxSum = ThisSum; else if(ThisSum < 0) ThisSum = 0; } return MaxSum;}2. 二分查找法int BinarySearch(const ElementType A[], ElementType X, int N 阅读全文
posted @ 2011-07-26 19:28 爱无限 阅读(548) 评论(0) 推荐(0) 编辑