50.8k views
3 votes
Dynamic programming, given a list of integers, pick the highest numbers. Can only pick a maxiμm of 2 numbers in a row:

a) True
b) False

1 Answer

0 votes

Final answer:

In dynamic programming, picking the highest numbers from a list with the constraint of picking a maximum of 2 numbers in a row.

Step-by-step explanation:

When using dynamic programming to pick the highest numbers from a list of integers, we need to consider the constraint that only two numbers can be picked in a row.

This means that after selecting one number, we cannot immediately select the next adjacent number.

Here's an example:

  1. If we have the list [5, 10, 2, 8, 6, 7], we can pick either 5 or 10 as the first number. If we choose 10, then the next highest number we can pick is 8. If we choose 8, then the next highest number we can pick is 7.

User Tkit
by
7.5k points