CIS 315 Intermediate Algorithms
Spring 2015
MIDTERM TEST
Friday, May 8, 2015
you are allowed one page of notes - turn-off wifi from laptop if using e-text
problems 1 and 3 are worth 11 points, problem 2 is 10 points, and problem 4 is 13 (total: 45)
1. S
CIS 315, Intermediate Algorithms
Winter 2016
Assignment 6
due Wed, March 2, 2016
1
Description
We want to devise a dynamic programming solution to the following problem: there is a string of
characters which might have been a sequence of words with all th
CIS 315, Intermediate Algorithms
Winter 2016
Assignment 5
due Wednesday, Feb 24, 2016
1. exercise R-5.9, p 282 [6 points]
2. For this dynamic programming problem and the next one, be sure to
(a) describe the subproblem
(b) give a recurrence for the subpro
CIS 315, Intermediate Algorithms
Winter 2016
Assignment 7
due Friday, March 11, 2016
1. exercise R-5.6 (GT) [5 points]
2. Consider a greedy strategy for the following problem:
We have a company with n workers. Worker wi works a shift (si , fi ), where si
CIS 315, Intermediate Algorithms
Winter 2016
Assignment 2
due January 25, 2016
1
Description
For this assignment, you are to write a program which will take the description of a series of
unweighted directed acyclic graphs from standard input and write to
Algorithms
atyuwen
atyuwen@gmail.com http:/hi.baidu.com/atyuwen
0 Prologue
Ex.0.1
a) f = ( g ) b) f = O ( g ) c) f = ( g ) d) f = ( g ) e) f = ( g ) f) f = O ( g ) g) f = ( g ) h) f = ( g ) i) f = ( g ) j) f = ( g ) k) f = ( g ) l) f = O ( g ) m) f = O
CIS 315 Intermediate Algorithms
Spring 2015
FINAL EXAMINATION
2015 June 8, am10:15
Open text(s) and two pages of notes.
WRITE YOUR NAME ON EACH PAGE.
1. We say that the string x = x1 x2 . . . xn is a subsequence of the string y = y1 y2 . . . ym in the
u
CIS 315 Intermediate Algorithms
Winter 2016
MIDTERM TEST SAMPLE SOLUTION
1. In a weighted graph with start node s, there are often multiple shortest paths from s to any
other node. We want to use Dijkstras algorithm to count them (so assume no negative ed
CIS 315 Intermediate Algorithms
Spring 2015
MIDTERM TEST SAMPLE SOLUTION
1. Suppose you have a weighted graph and two specified nodes s and t. Here the (positive)
weight of an edge (u, v) refers to the number of liters of gasoline your car needs to travel
Algorithm Design
M. T. Goodrich and R. Tamassia
John Wiley & Sons
Solution of Exercise R-1.7
The numbers in the first row are quite large. The table below calculates it approximately in powers of 10. People might also choose to use powers of 2. Being clos