0% found this document useful (0 votes)
3 views

12 Excise DynamicProgramming 1

The document outlines exercises related to dynamic programming, including strategies for finding shortest paths in graphs, solving the longest increasing subsequence problem, and addressing resource allocation and longest common subsequence problems. It provides specific tasks requiring the application of dynamic programming algorithms to various scenarios. The exercises are structured to enhance understanding of dynamic programming concepts and their practical applications.

Uploaded by

a9825434
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

12 Excise DynamicProgramming 1

The document outlines exercises related to dynamic programming, including strategies for finding shortest paths in graphs, solving the longest increasing subsequence problem, and addressing resource allocation and longest common subsequence problems. It provides specific tasks requiring the application of dynamic programming algorithms to various scenarios. The exercises are structured to enhance understanding of dynamic programming concepts and their practical applications.

Uploaded by

a9825434
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

Introduction to Algorithms

Lecture Exercise: Dynamic Programming (1)

Name: Class: ID: Date:


1. What is the dynamic programming strategy?
2. (a) Describe a dynamic programming algorithm to find a shortest path from v to u on a graph G = (V, E).
(b) Use your algorithm to find the shortest path from S to T.

3. (a) What is the longest increasing subsequence problem for a given sequence S of numbers?
(b) Describe a dynamic programing method for the longest increasing subsequence problem.
4. What is the principle of optimality?
5. (a) Describe a dynamic programming algorithm to solve the resource allocation problem.
(b) For the following table, use your algorithm to find an optimal allocation of resources to maximize the total
profit for those three projects and four resources.
resource
1 2 3 4
project
1 3 7 10 12
2 1 2 6 9
3 2 4 8 9

6. (a) Describe a dynamic programming algorithm to find a longest common subsequence of strings S1 and S2.
(b)Use your algorithm to find a longest common subsequence of S1 = TGACATTA and S2 = ATCTGAGTAT.

You might also like