CIS 315 Intermediate Algorithms
Spring 2016
MIDTERM TEST
Friday, May 6, 2016
You are allowed one page of notes. Problems 1 and 3 are worth 11 points, problem 2 is 10 points,
and problem 4 is 13 (total: 45)
1. Suppose you are given a diagram of a telephone
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
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
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
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
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
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 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 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
assignments bash BOXZ4
Your branch ' LIbtodate w1th 'or1g1nfmaster'
ChanUes not ged tor comm1t:
1Zuse g1t s 2?. to update what w111 be comm1tted1
1;Zu g1t " "' to d1scard changes 1nv1ork1ng d1rectory1
add andor g1t comm1t a 1
junchengwu$ g1t add 1
' g1t c
CIS 315 Intermediate Algorithms
Spring 2016
MIDTERM TEST SAMPLE SOLUTION
1. Suppose you are given a diagram of a telephone network, which is a graph G whose vertices
represent switching centers, and whose edges represent communication lines between two
ce
Comparing Arguments
Common Phrases
Banks (2011) and Coontz (2012) both argue that
Both Banks (2011) and Coontz (2012) argue that
Banks (2011) believes thatSimilarly, Coontz
(2012) states that
Banks (2011) believ
CIS 315, Intermediate Algorithms
Winter 2017
Assignment 1
due January 23, 2017
1. Suppose you are given the adjacency matrix representation M of a directed graph G = (V, E).
Note that the size of M is (n2 ). The goal here is to determine if there is a nod
CIS 315, Intermediate Algorithms
Winter 2017
Assignment 3
due Friday, February 3, 2017
1. Consider the graph below. You will be building a MST for this graph in two ways. When
there is a tie on the edge weights, consider the edges or nodes in alphabetical
CIS 315, Intermediate Algorithms
WInter 2017
Assignment 0
due January 18, 2017
1
Description
For this assignment, you are to write a program which will read a series of pairs of integers X and
Y and print pairs X + Y and X Y . The purpose of this assignme
CIS 315, Intermediate Algorithms
Winter 2017
Assignment 4
due Monday, February 13, 2017
1. Illustrate the Floyd-Warshall algorithm on the graph described by the following weight matrix:
0 1
1
0 2
2 0 8
W =
3
4 0
7 0
5 10 0
[6 points]
2. We are g
Juncheng Xu CIS315 HW 5
Problem 1
1
1
2
3
4
5
6
0
100
500
820
756
2356
0
200
600
616
1656
0
480
576
1056
0
960
5760
0
2880
2
3
4
5
6
0
The best way is (A1*A2)(A3*A4)*A5)*A6) when it is 2356 multiplication.
Problem2
(a) Assume L(I,j) is set of all values o
CIS 330: Project #2F
Assigned: April 23rd, 2015
Due April 29th, 2015
(which means submitted by 6am on April 30th, 2015)
Worth 4% of your grade
Assignment: You will implement 3 structs and 9 functions. The prot
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