CS 470 Exam 1
Fall 2009
Name_
1. Suppose that we want to write a function that returns the i smallest values (in sorted order) from an
unsorted list of N values. In just a sentence or two describe an algorithm and its running time for each
of the three so
CS 470/570 Exam 4
Fall 2010
Name _
CS 470: Your grade will be based on your best 4 of these 5 problems.
CS 570: Solve all 5 problems.
1. First draw a minimum spanning tree for this graph, and specify the minimum total cost.
Next draw a maximum spanning tr
CS 470/570 Exam 4
Fall 2010
Solution
CS 470: Your grade will be based on your best 4 of these 5 problems.
CS 570: Solve all 5 problems.
1. First draw a minimum spanning tree for this graph, and specify the minimum total cost.
Next draw a maximum spanning
CS 470/570 Design and Analysis of Algorithms
Final Exam Fall 2006 Prof. Phillip G. Bradford Circle one: 470/570
Name: Student ID:
This test is closed book and closed notes. The best answers are well thought-out brief answers that entirely encompass a corr
CS 470/570 Design and Analysis of Algorithms Name: Student ID:
Midterm 3 Fall 2006 Prof. Phillip G. Bradford
This test is closed book and closed notes. The best answers are well thought-out brief answers that entirely encompass a correct answer. You must
Lecture Notes for CS470 Fall 2005 Part 6 (preliminary draft)
Topological sort [Give a realistic example of events, dependencies between them, and their ordering the events - building a home] Suppose that you have a certain set of tasks to perform, and the
Lecture Notes for CS470 Fall 2005 Part 3 (preliminary draft)
2. The recursion tree method ["forming an educated guess"] The substitution method required a guess, but sometimes it is not easy to make a guess that gives a tight bound [we could have guessed
Lecture Notes for CS470 Fall 2005 Part 5 (preliminary draft)
Graph algorithms Definitions A directed graph is a pair (V,E) where V is a finite set of elements called vertices, and E is a set of ordered pairs (u,w), called edges (or arcs), of vertices.
A s
Lecture Notes for CS470 Fall 2005 Part 4 (preliminary draft)
Lower bound on time of sorting So far we have seen one algorithm that sort in time (n log n) in the worst-case: mergesort. One may wonder, is it possible to sort faster? In general when we try t
Lecture Notes for CS470 Fall 2005 Part 2 (preliminary draft)
1. Notion of an algorithm and some definitions; Section 1 Algorithm is a description of how to transform a value, called input, to a value, called output. The description must be precise so that
CS 470/570 Exam 3
Fall 2010
Solution
CS 470: Your grade will be based on your best 4 of these 5 problems.
CS 570: Solve all 5 problems.
1. Trace the greedy algorithm for the instance of the fractional knapsack problem shown
below with maximum capacity = 1
CS 470/570 Exam 3
Fall 2010
Name _
CS 470: Your grade will be based on your best 4 of these 5 problems.
CS 570: Solve all 5 problems.
1. Trace the greedy algorithm for the instance of the fractional knapsack problem shown
below with maximum capacity = 11.
CS 470 Exam 2
Fall 2009
Name_
1.
a. Construct an undirected graph with 7 vertices and 20 edges, and give each edge a distinct
weight from the set cfw_120 (use each weight once) such that the largest weight edge is in
the MST.
b. Illustrate Prims and Krusk
CS 470/570 Exam 1
Fall 2010
Name _
CS 470: Your grade will be based on your best 5 of these 6 problems.
CS 570: Solve all 6 problems.
1. Write a precise definition for each of these relations. You may assume that functions F(n)
and G(n) are nonnegative an
CS 470/570 Exam 1
Fall 2011
Name _
1. Solve each recurrence below and express T(n) as the simplest function of n.
a. T(n) = 25 T(n/5) + n3
b. T(n) = 64 T(n/4) + n3
c. T(n) = 81 T(n/3) + n3
d. T(n) = 2 T(n1) + 1
2. We are given an array A that contains n d
CS 470/570 Exam 1
Fall 2010
Solution
CS 470: Omitted 2 lowest, so grade is based on your best 4 of these 6 problems.
CS 570: Omitted 1 lowest, so grade is based on your best 5 of these 6 problems.
1. Write a precise definition for each of these relations.
CS 470/570 Exam 1
Fall 2011
Solution
1. Solve each recurrence below and express T(n) as the simplest function of n.
a. T(n) = 25 T(n/5) + n3
(n3)
b. T(n) = 64 T(n/4) + n3
(n3 lg n)
c. T(n) = 81 T(n/3) + n3
(n4)
d. T(n) = 2 T(n1) + 1
(2n)
2. We are given a
CS 470/570 Exam 2
Fall 2010
Name _
CS 470: Your grade will be based on your best 4 of these 5 problems.
CS 570: Solve all 5 problems.
1. Recall the selection problem: Given a list of n values and an integer k, find the kth smallest
value. First describe t
CS 470/570 Exam 2
Fall 2011
Name _
1. Trace the dynamic programming algorithm for the matrix chain product M1 M2 M5, using
the array of dimensions as given below. So each value cost(i,j) should be the minimum
number of scalar multiplications needed to com
CS 470/570 Exam 2
Fall 2010
Solution
CS 470: Your grade will be based on your best 4 of these 5 problems.
CS 570: Solve all 5 problems.
1. Recall the selection problem: Given a list of n values and an integer k, find the kth smallest
value. First describe
CS 470/570 Exam 2
Fall 2011
Solutions
1. Trace the dynamic programming algorithm for the matrix chain product M1 M2 M5, using
the array of dimensions as given below. So each value cost(i,j) should be the minimum
number of scalar multiplications needed to
Lecture Notes for CS470 Fall 2005 Part 7 (preliminary draft)
Minimum Spanning Tree Consider the following transportation problem. We are given n cities, and the costs of constructing a road between pairs of cities [for some pair we may not know the cost o