Lab 3 Dynamic Programming

1. Find the maximum contiguous subsequence sum in an array of integers.

2. Consider a row of n coins of values v(1) …v(n), where n is even. We play a game against an opponent by alternating turns. In each turn, a player selects either the first or last coin from the row, removes it from the row permanently, and receives the value of the coin. Determine the maximum possible amount of money we can definitely win if we move first. (Consider the other player is smart and makes the best choice.)

Leave a comment