Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Finding the largest sub vector in a sequence

  • 14-09-2009 11:52AM
    #1
    Registered Users, Registered Users 2 Posts: 46


    Hi folks,
    I need to find the largest sub-vector from a sequence of integers, both positive and negative. For example:

    6,94,-63,-41,20,5,-61,83,-14,-50,
    36,30,32,51,96,72,99,23,-59,-23,
    The largest sub vector here is
    6,94,-63,-41,20,5,-61,83,-14,-50,
    36,30,32,51,96,72,99,23,-59,-23,

    Any ideas?
    Is there an algorithim that will do this?
    Cheers


Comments

  • Registered Users, Registered Users 2 Posts: 2,164 ✭✭✭cavedave


    This is called the largest subsequence problem. There is stuff on it here and here. Both these seem to use dynamic programming.


Advertisement