Maximum subarray problem

Find maximum subarray problem by using Kadane's algorithm
61 download
Aggiornato 30 mag 2016

Visualizza la licenza

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)
-------------------------------------------------------------------------

Cita come

Trong Hoang Vo (2026). Maximum subarray problem (https://it.mathworks.com/matlabcentral/fileexchange/57431-maximum-subarray-problem), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2014b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Electrical Block Libraries in Help Center e MATLAB Answers

Kadane'sAlgorithm/

Versione Pubblicato Note della release
1.0.0.0