Skip to content
Back to libraryPart 3 · Graphs and dynamic programming

3.5Dynamic programming II

Before you start

It helps to have read 3.4 Dynamic programming I, 1.5 Sorting and 2.3 Binary search. Overall level: Upper intermediate.

Practice: Dynamic programming II

0 of 4 solved

About these problems

Apply, Connect, Reason and Stretch describe difficulty within this topic, not an official contest rating. Open any problem in any order; reading the chapter first is optional.

  1. 1One-use equipmentThere are n items with weight w_i and value v_i. Choose each item at most once with total weight at most W. Print the maximum total value. Choosing nothing is allowed.ApplyNot started
  2. 2Shared subsequenceFind the length of a longest sequence of characters appearing in both strings in the same order, not necessarily consecutively.ConnectNot started
  3. 3Edit the identifierFind the minimum operations to turn s into t. Each operation inserts one character, deletes one character or substitutes one character, at cost 1.ReasonNot started
  4. 4Assign the jobsAssign each of n workers exactly one distinct job among n jobs. Worker i doing job j costs c[i][j]. Print the minimum total cost.StretchNot started

Read the lesson