| # | required problems | topic | ||
|---|---|---|---|---|
| 1 | Your favorite sawmill charges by the length to cut a piece of lumber.
(For example, to cut a 7 foot piece at any point costs 7 cents.)
|
dynamic pgm | ||
| 2 | CLR Problem 15-2 on page 365 | printing neatly | ||
| 3 | Consider the function:
|
algorithm based on recurrence |
| # | suggested problems | topic |
|---|---|---|
| 4 | CLR Exercise 15.4-6 on page 356 | longest increasing subsequence |
| 5 | CLR Problem 15-1 on page 364 | bitonic euclidean tsp |
| 6 | Baase Exercise 10.9 on page 477 | optimal bst |
| 7 | Find an optimal binary search tree for the probabilities
|
optimal bst |
| 8 | Find the optimal binary search tree consisting of
n elements having probabilities
|
optimal bst |
| 9 | Baase Exercise 10.16 on page 478 | dynamic pgm - binomial coefficients |
| 10 | Baase Exercise 10.21 on page 479 | dynamic pgm - partition problem |
| 11 | The Strahler number of a binary tree is defined as
follows: An empty tree has Strahler number 0. If the binary tree T has subtrees TL and TR, the Strahler number S(T) of T is defined by max{ S(TL),S(TR) }, if S(TL) ≠ S(TR) S(TL) + 1, otherwise |
dynamic pgm |
| 12 | One version of the game of Nim is played with counters that are
arranged in three rows.
A position (the pattern of counters) can be
conveniently represented by an ordered triple of integers
describing the number of counters in each row.
The game is played by two persons who move in turns. Each move consists of removing one or more counters from one of the rows. A player wins if he/she removes all remaining counters, i.e., the position <0,0,0> results from his/her move. Any position in which the next player to move, if he/she moves correctly, is guaranteed to eventually win (regardless of which moves his/her opponent may make) is called a winning position. Let WIN(i, j, k) be true iff <i, j, k> is a winning position.
|
Nim |
| 13 | Let T be a complete binary tree with
n = 2k-1 nodes.
The nodes are numbered in level order with the root labelled 1,
its two children labelled 2 and 3, etc.
Let Ti be the subtree whose root is node i,
and so T1 = T.
Every node i has a value VAL[i] which can be positive
or negative or zero.
We define WT(i) to be the weight of subtree i,
given by the sum of all values of the nodes in Ti.
The problem is to find the maximum weight of all subtrees of T.
|
DC+dyn pgm |
| 14 | DPV exercise 6.4 on p.178 You are given a string of n characters s[1...n], which you believe to be a corrupted text document in which all punctuation has vanished (so that it looks something like "itwasthebestoftimes..."). You wish to reconstruct the document using a dictionary, which is available in the form of a Boolean function dict(*) such that, for any string w, dict(w) has value 1 if w is a valid word, and has value 0 otherwise.
|
dynamic pgm |
| 15 | DPV exercise 6.5 on p.178 We are given a checkerboard which has 4 rows and n columns, and has an integer written in each square. We are also given a set of 2n pebbles, and we wish to place some or all of these on the checkerboard (each pebble can be placed on exacyly one square) so as to maximize the sum of integers in the squares that are covered by pebbles. There is one constraint: for a placement of pebbles to be legal, no two of them can be on horizontally or vertically adjacent squares (diagonal adjacency is fine).
Call two patterns compatible if they can be placed on adjacent columns to form a legal placement. Let us consider subproblems consisting of the first k columns 1≤k≤n. Each subproblem can be assigned a type, which is the pattern occurring in the last column.
|
dynamic pgm |