Either case is O(n), in fact.

On 8/23/07, ilija <[EMAIL PROTECTED]> wrote:
>
>
> If the subarray needs to be continuous, then you can do it using DP.
> If it doesn't, you can do it using an O(n) algo - simply sum all the
> positive integers.
>
> On 22 kol, 19:55, Ravi <[EMAIL PROTECTED]> wrote:
> > You're given an array containing both positive and negative integers
> > and required to find the subarray with the largest sum.
> > Write a routine in C for the above.
>
>
> >
>


-- 
Fear of the LORD is the beginning of knowledge (Proverbs 1:7)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/algogeeks
-~----------~----~----~----~------~----~------~--~---

Reply via email to