CSCE 629 Homework 3

advertisement

CSCE 629 Homework 3

June 11, 2012

Homework 3 is due Wednesday, June 20, in class.

Read Chapters 15-17 of the text

1.

Problem 15-1, page 404. Suppose that we are given a directed acyclic graph, G = (V,E), with real-valued edge weights and two distinguished vertices s and t. Describe a dynamic programming approach for finding a longest weighted simple path from s to t. What does the subproblem graph look like? What is the efficiency of your algorithm?

2.

Problem 15-3, page 405. (2 nd edition: Problem 15-1, page 364—Bitonic TSP)

3.

Problem 16-1, page 446-7 (2 nd edition, Problem 16-1, page 402.

4.

Exercise 17.3-6, page 463. Show that the amortized cost per operation is constant. (2 nd edition:

Exercise 17.3-6, page 416)

5.

Suppose you were trying to maintain dynamic tables as the text described, but your goal is to ensure that the table is never less than 1/16 full? What size table would you move to when a deletion would cause the table to be less than 1/16 full? What size table would you move to when the table is full? What potential function would you use to show the amortized time is linear? Using your potential function, show that the time is linear.

Download