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. So 3 2 7 10 should return 13 (sum of 3 and 10) or 3 2 5 10 7 should return 15 (sum of 3, 5 and 7)


No Answer is Posted For this Question
Be the First to Post Answer

Post New Answer

More Programming Languages AllOther Interview Questions

what are the missinschema properties and should we pass primary key in select command

0 Answers  


WS-NUM PIC S9(05)V(02) SIGN TRAILING SEPARATE MOVE '0050000+' TO WS-NUM The value stored is 00500,00+ MOVE '0050000-' TO WS-NUM Then what is the value will be stored in WS-NUM? Am getting '-00500,00'.....>>> What should I declare to WS-NUM so that I can get correct values for both + & - signs.

0 Answers  


what is apt_dump_score in datastage where it is useful

0 Answers   Accenture,


How to use string functions in QTP?give some examples

1 Answers  


what is the difference between read the data from table and infotype

0 Answers  


3. . Explain the Cache memory? What is the advantage of a processor having more cache memory?

1 Answers  


what is different between kenerl mode and user mode?

1 Answers  


i want to improve my english vocab for racking campus written exam plz tell me best book for prepration......

0 Answers  


Why multiple inheritance is removed in java?

4 Answers   TCS,


can we retrieve only integer/String type columns from a table,if yes how?

0 Answers  


What is the best action a system can take when deadlock is detected

2 Answers  


what is adodb??y it is used for connection of V.B and access??what is ado?dao?

0 Answers   TCS,


Categories