How about in-place merge sort ? isnt it o(nlogn) & 2 lookups...

On Wed, Jun 30, 2010 at 8:26 PM, jalaj jaiswal <[email protected]>wrote:

> i did it using dynamic programming.. but i'm using O(n) space ..can any1 do
> it inplace..
>
>
>
>
> On Wed, Jun 30, 2010 at 7:00 PM, jalaj jaiswal 
> <[email protected]>wrote:
>
>> You have an array of n nonzero numbers. The array is randomly filled with
>> positive and negative numbers.
>>
>> Write an algorithm/program to find 2 such indexes in the array, so as the
>> sum of the numbers between these indexes is the maximum. O(n).
>>
>> please explain the logic
>>
>> --
>> With Regards,
>> Jalaj Jaiswal
>> +919026283397
>> B.TECH IT
>> IIIT ALLAHABAD
>>
>
>
>
> --
> With Regards,
> Jalaj Jaiswal
> +919026283397
> B.TECH IT
> IIIT ALLAHABAD
>
> --
> You received this message because you are subscribed to the Google Groups
> "Algorithm Geeks" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<algogeeks%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/algogeeks?hl=en.
>



-- 
cheers
Jeeva

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to