bY_1998's blog

By bY_1998, 4 years ago, In English

Hi I am stuck in a problem which I have written below, I doubt whether there is a linear time algorithm which can solve it , If anyone finds any solution please provide me the solution or give some hints at least.

Thanks in advance!!

============================================================================================================================================================================================================================================

Question:---

You are given an array A1 , A2 , . . . ,An of integers (both positive and negative), and a integer l, 0<l ≤ n. The length of a subsequence is defined as the number of integers in the subsequence. Design a linear time algorithm to find the a maximum sum subsequence of length at most l.

Full text and comments »

  • Vote: I like it
  • -25
  • Vote: I do not like it