Calculate maximum sum of any subarray set - Zero Lee
Zero Lee
·
2012-06-17
·
via 博客园 - Zero Lee
Given one array, and calculate its maximum sum from any sequential subarray setCpp code demo as below: 1 int maxSubarraySum(int arr[], int length, int& beg, int& end) 2 { 3 assert(arr!=0); 4 int maxSum = 0; 5 int tmpSum = 0; 6 beg = 0; end = 0; 7 for (int i = 0; i < length; i++) ...
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。