Thursday, February 10, 2011

Largest Sum Sub array

Problem statement : You have an arrya having both postive and negative number. You have to find a sequence having maximum sum.
Program should be not more then O(n) complexity

Hint: Though problem looks complex. Its logic lies if any time your temp Sum becomes less then 0, it will not contribute to the MaxSum

No comments: