CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for the Midterm Exam
1. Assume that the function T satises the following recurrence relation
T (n) = 2T ( n) + log n,
whenever n is a pe
CS 584 Algorithms; Design and Analysis
Fall term 2013
Homework 1, due Wednesday, September 18
Most homeworks will be worth 100 points; consider the point value in
determining how much time you spend o
CS 584 Algorithms: Design and Analysis
Fall term 2013
Homework 2, due Wednesday, October 2
READING: Chapters 6-9.
1. In our MERGE-SORT algorithm we merged two sorted lists into one
sorted list in O(n)
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for Homework 1
1. Find the least integer k such that f (n) is O(nk ) for each of the following
functions:
(a) f (n) = 2n2 + n3 log n
(b)
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for Homework 5
1. Describe an algorithm for nding a spanning tree with minimal weight
containing a specied acyclic (cycle-free) set of e
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for Homework 3
1. Exercise 12.2-5 on page 293.
Solution: Let x be a node with two children. Since x has a right child
the successor s of
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for Homework 4
1. Suppose we perform a sequence of n operations on a data structure
in which the i-th operation costs i if i is an exact
CS 584 Algorithms: Design and Analysis
Fall term 2013
Homework 3, due Wednesday, October 30
READING: Chapters 10-12, 15-17.
1. Exercise 12.2-5 on page 293. (15 points)
2. In an experiment you pick at
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for Homework 2
1. In our MERGE-SORT algorithm we merged two sorted lists into one
sorted list in O(n) time. Describe an O(n log k )-time
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for Homework 6
1. Suppose you seek a ow f in a multiple source, multiple sink network
G = (V, E ), where V = cfw_s1 , . . . , sm , t1 ,
CS 584 Algorithms: Design and Analysis
Fall term 2013
Solutions for the Practice Final Exam
These problems are sample problems for the nal exam, so you may expect
similar problems in the nal. Do not h
CS 584 Algorithms: Design and Analysis
Fall term 2017
Practice Midterm Exam
These problems are sample problems for the midterm exam, so you may
expect similar problems in the midterm. Do not hand in y
CS 584 Algorithms: Design and Analysis
Fall term 2017
Solutions for Homework 1
1. Find the least integer k such that f (n) is O(nk ) for each of the following
functions:
(a) f (n) = 2n2 + n3 log n
(b)
CS 584 Algorithms: Design and Analysis
Fall term 2017
Solutions for the Practice Midterm Exam
These problems are sample problems for the midterm exam, so you may
expect similar problems in the midterm
CS 584 Algorithms: Design and Analysis
Fall term 2017
Homework 2, due Wednesday, September 27
READING: Chapters 6-9.
1. Suppose wewant to find the k smallest numbers in a list of n numbers,
where k =
CS 584 Algorithms: Design and Analysis
Fall term 2013
Practice Final Exam
These problems are sample problems for the nal exam, so you may expect
similar problems in the nal. Do not hand in your soluti
CS 584 Algorithms: Design and Analysis
Fall term 2014
Homework 5, due Wednesday, December 3
READING: Chapters 24-26, 31.
1. Let G = (V, E) be a weighted, directed graph with n vertices and m
edges, wh
CS 584 Algorithms: Design and Analysis
Fall term 2017
Homework 3, due Wednesday, October 11
READING: Chapters 10-12, 15-17.
1. Exercise 12.2-4 on page 293. (20 points)
2. This problem is about conditi
CS 584 Algorithms; Design and Analysis
Fall term 2017
Homework 1, due Wednesday, September 13
Most homeworks will be worth 100 points; consider the point value in
determining how much time you spend o
CS 584 Algorithms: Design and Analysis
Fall term 2017
Solutions for Homework 2
1. Suppose wewant to find the k smallest numbers in a list of n numbers,
where k = n. Design an algorithm that solves thi
CS 584 Algorithms: Design and Analysis
Fall term 2017
Solutions for Homework 3
1. Exercise 12.2-4 on page 293.
Solution: We have the following counterexample on 4 vertices. Here
4 in on the search pat
CS 584 Algorithms: Design and Analysis
Fall term 2017
Solutions for the Midterm Exam
1. Use the Master Theorem to find the asymptotic solution for the following recurrence: T (n) = 9T ( n3 ) + n2 .
So
Software Development
CS_509 Lesson 1
SW Development Lifecycle (SDLC)
2
2017 Blake Nelson
Worcester Polytechnic Institute
Learning Objectives
Need for formalized software engineering processes
Know
CS 584 Algorithms: Design and Analysis
Fall term 2013
Homework 4, due Wednesday, November 13
READING: Chapters 17, 19.
1. Suppose we perform a sequence of n operations on a data structure
in which the
CS 584 Algorithms: Design and Analysis
Fall term 2013
Homework 6, due Wednesday, December 11
READING: Chapters 26, 34, 35.
1. Suppose you seek a ow f in a multiple source, multiple sink network
G = (V
CS5084: Algorithms Fall 2013
Solution for Homework 4
Posted: 22:25, September 29, 2013
1. Exercise 5.2-4, page 122.
One version of the hat-check problem: A restaurant gets each of its n customers to l
CS5084: Algorithms Fall 2013
Solution for Homework 2;
Time posted: September 16, 2013, 23:22
1. This is about using the integer functions, floor and ceiling, that you saw in analyzing binary search.
O
CS5084: Algorithms Fall 2013
Homework 9
The first two problems are still about dynamic programming, and they are both quite involved.
1. TSP the Traveling Salesman Problem is formulated as follows: Gi
CS5084: Algorithms Fall 2013
Homework 1
Note: The occasional starred () exercise is for the ambitious, and will not be used in the test.
1. Show that
k1
= 0. It is simple if you use a result shown in