Maximum subarray problem

Find maximum subarray problem by using Kadane's algorithm

您现在正在关注此提交

Maximum subarray problem
Description: This function will find Maximum subarray problem by using Kadane's algorithm.

Input: Array 'A'
Output:
'max_so_far' is a maximum value,
'B' is a subarray has 'max_so_far' value

Example: A = [7 4 -5 6 -4 2 3 -7] --> [max_so_far, B] = Kadane(A)
--> max_so_far = 13, B = [7 4 -5 6 -4 2 3]

Complexity: O(n)
-------------------------------------------------------------------------
Author: Trong Hoang Vo
Date: May 30, 2016
Contact: hoangtrong2305@gmail.com (my Gmail)
facebook.com/hoangtrong2305 (my Facebook)
-------------------------------------------------------------------------

引用格式

Trong Hoang Vo (2026). Maximum subarray problem (https://ww2.mathworks.cn/matlabcentral/fileexchange/57431-maximum-subarray-problem), MATLAB Central File Exchange. 检索时间: .

类别

Help CenterMATLAB Answers 中查找有关 Electrical Block Libraries 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.0.0.0