Home ยป Answer

Answer for Given an array all of whose elements are positive numbers,


Ques:

Given an array all of whose elements are positive numbers, find the maximum sum of a subsequence with the constraint that no 2 numbers in the sequence should be adjacent in the array.

i) 3 2 7 10 should return 13 (sum of 3 and 10)
ii) 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)
 

Answer:
CONNECT WITH US
CONTACT US
 Email Id: [email protected]
Copyright © Jobzalert - All Rights Reserved.