you cannot choose 7 and 10 since they are adjacent On Mon, Aug 1, 2011 at 1:17 PM, Prakash D <[email protected]> wrote:
> i can write a O(n^2) soln. but i hope there could be a better way > > > On Mon, Aug 1, 2011 at 12:46 PM, Abhishek Gupta <[email protected]>wrote: > >> let the array be A={ 3,5,7,10} then it should give output as 13 (3+10) >> >> In short, we need to find the possible maximum sum such that no 2 elements >> in the subarray has 2 elements adjacent. there is no bound on the size of >> subarray. >> -- >> Abhishek Gupta >> MCA >> NIT Calicut >> Kerela >> >> -- >> 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. >> > > -- 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.
