Fall 2012
CS 344: #1 Math Fundamentals
Farach-Colton
Due by 5:00pm, Due: Sept. 13.
1. Prove, using the denitions, that
loga x
= logb x.
loga b
Prove that
log x
x
=
.
y
log y
2. Prove by induction on k : (Remember these formulas, they may be used later)
(a
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Homework 1 - Solutions
Asymptotic and Number Theoretic Algorithms
Part A (20 points)
1
Problem 1:
In each of the following situations indicate whether = O(g) or = (g) or = (g):
Note: The g n f
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Midterm Exam
Name:
Perfect score: 100 points - Available points: 112.
No notes or books are allowed.
A. Specify whether the following statements are true or false and argue why:
- For any pair
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Homework 3
Dynamic Programming and Graph Search
Deadline: April 4, 11:59pm.
Available points: 110. Perfect score: 100.
Homework Instructions:
Teams: Homeworks should be completed by teams of s
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 3 Solutions
TITLE
Part A (20 points)
Problem 1:
Let Track 1 to have n points and track 2 to have m points. We need two tables, each one for
the Euclidean distances between every pair
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 2 Solutions
Divide-and-Conquer Algorithms, Sorting Algorithms, Greedy Algorithms
Problem 1 [20 points]
The more general version of the Master Theorem is the following. Given a recurre
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Homework 1
Asymptotics and Number Theoretic Algorithms
Deadline: February 18, 11:59pm.
Available points: 120. Perfect score: 100.
Homework Instructions:
Teams: Homeworks should be completed by
Fall 2012
CS 344: #3 Sorting
Farach-Colton
Due by 5:00pm, Sept. 27.
1. The merge algorithm presented in class was not in place. Assume you are given
an array A[1], ., A[n] where A[1], ., A[k ] is one sorted list and A[k + 1], ., A[n]
is another sorted lis
CS344 HW2
(2.1)
1001101110111010=28 P +24 (P P P )+P 11 13 11 12 12
P =10011011=24 P +22 (P P P )+P 11 21 23 21 22 22
P =10111010=24 P +22 (P P P )+P 12 31 33 31 32 32
P =1010010101=24 P +22 (P P P )+P
P =4,P =3,P =15 21 22 23
P =4,P =6,P =20 31 32 33
P =
log(n!);
p
2
1
n log n; n 2 + log n; n log n ; 2log n ; 2n
10
log(n!)
=
(n log n)
n log n
=
n 2 + log n
p
n log n
=
o(n 2 + log n)
p
o( n l og n )
=
(2log
2
l og n
2
=
2
n
)
n
o(2 )
log(n!) = (n log n)
log(n!) = O(n log n)
log(n!)
=
log(n n 1 : : : 2 1)
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 4
Deadline: 11:59pm, April 5, 2013
Available points: 110. Perfect score: 100.
You will receive 10% extra credit points if you submit your answers as a typeset PDF (preferably
using LA
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 3 - Solutions
Deadline: 11:59pm, March 29, 2013
Available points: 112. Perfect score: 100.
Problem 1 (24 points): The solution to this problem follows a Dynamic Programming approach.
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Homework 4
Searching for Paths on Graphs
Deadline: April 20, 11:59pm.
Available points: 110. Perfect score: 100.
Homework Instructions:
Teams: Homeworks should be completed by teams of student
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Homework 4 - Solutions
Problem 1: After Storm Sandy leaves, the small town of New Town is undergoing an electricity
power shortage. To recover the electricity service in the town, the local el
SEARCH ALGORzmMs r0541 GRAPHS
+APPHCATIONS
—}— IMPLE MENTAT ION {SS‘J‘ES
DFS
BF 5
DUKSTRA" GRAPHS W COMWJTEK 505-963 BASBC OPERA
EFFICIENCY
OF THE SAME WA?
TEONS RUN [WITH DIFFERENT
ump gammy
M31? MA } RM
DEHX) OW
max) 00'»)
OM) 0(6)
ON DiFFERENT REPRESEN
Chapter 3
Decompositions of graphs
3.1 Why graphs?
A wide range of problems can be expressed with clarity and precision in the concise pictorial
language of graphs. For instance, consider the task of coloring a political map. What is the
minimum number of
Sample Midterm 2, Course 344
November 16, 2015
Problem 1. (12 pts) Run Prims algorithm from Node 1 to determine the
minimum weight spanning tree of the graph.
2
4
7
8
1
1
6
6
20
5
7
2
5
10
4
7
3
1
7
3
4
2
8
List all of the nodes in the oder Prim nds them.
Dynamic Programming
Dynamic Programming
1
General Dynamic Programming
Technique
Applies to a problem that at first seems to require a lot
of time (possibly exponential), provided we have:
n
n
Subproblem optimality: the global optimal solution can be
de
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Practice Questions and Reading Material
The nal exam is cumulative and will include problems relating to all the lectures. Please go over
all three study guides. The current study guide includ
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Practice Questions and Reading Material
Note: The chapters and exercises from the books are provided as supportive references for the
material covered during the lectures.
Greedy Algorithms: H
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Practice Questions and Reading Material
Note: The material from the books is provided as a supportive reference for the material covered
during the lectures.
Introduction to Concepts of Algori
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Midterm Exam
Name:
Perfect score: 100 points - Available points: 112.
No notes or books are allowed.
A. Specify whether the entire following statements are true or false and argue why:
- A dyn
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 5
Deadline: 1:30pm, May 6, 2013
Available points: 100. Perfect score: 100.
You will receive 10% extra credit points if you submit your answers as a typeset PDF (preferably
using LATEX
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 5 - Solutions
Deadline: 1:30pm, May 6, 2013
Available points: 100. Perfect score: 100.
Problem 1 (30 points):
a) Provide an efficient algorithm that returns a classification of your c
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 3
Deadline: 11:59pm, March 29, 2013
Available points: 112. Perfect score: 100.
You will receive 10% extra credit points if you submit your answers as a typeset PDF (preferably
using L
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2013
Homework 4 - Solutions
Deadline: 11:59pm, April 5, 2013
Available points: 110. Perfect score: 100.
Problem 1 (35 points): To solve this problem, we will first construct a graph using the conve
CS 344: DESIGN AND ANALYSIS OF COMPUTER ALGORITHMS
SPRING 2014
Homework 1
Asymptotics and Number Theoretic Algorithms
Deadline: February 18, 11:59pm.
Available points: 110. Perfect score: 100.
Homework Instructions:
Teams: Homeworks should be completed by
Assignment 2
Paul Jones and Matthew Klein
Professor Professor Kostas Bekris
Design and Analysis of Computer Algorithms (01.198.344)
March 16, 2014
1
Divide-and-Conquer Algorithms, Sorting Algorithms, Greedy Algorithms
Part A (20 points)
Problem 1
The more