Find Max sum in a 2D array | PROGRAMMING INTERVIEWS What is needed for extending kadane algorithm is...

Please Visit: http://ift.tt/1ajReyV



Find Max sum in a 2D array | PROGRAMMING INTERVIEWS

What is needed for extending kadane algorithm is as followed:

Traverse matrix at row level.

have a temporary 1-D array and initialize all members as 0.

For each row do following:

add value in temporary array for all rows below current row (including current row)

apply 1-D kadane on temporary array

if your current result is greater than current maximum sum, update.

http://ift.tt/1mVz8KK

http://ift.tt/1lgOTR9



Find Max sum in a 2D array | PROGRAMMING INTERVIEWS







from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1mVz8KS

via LifeLong Community

No comments:

Post a Comment