Illinois Institute of Technology
Department of Computer Science
Homework Assignment 0
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Rules for Homework
On this and all future homework assignments, observe these guidelines or credit will be d
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 11
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Solution:
1. (PhD problem) Show that the class P , viewed as a set of languages, is closed und
Illinois Institute of Technology
Department of Computer Science
Homework 2 Solutions
CS 535 Introduction to Algorithms
Fall Semester, 2016
1. Problem 1
Solution:
For convenience, we describe a job as (s, f ), where s is the jobs start time and f is the jo
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 4
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
1. By Case 1 of the Access Lemma, we know that the amortized cost of ZIG (ZAG) at node x is at
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 7
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Solution:
1. When j = 1, A3 (1) > tower(j).
Suppose A3 (j) > tower(j) when j 1, then we have
A3
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 12
CS 535 Introduction to Algorithms
Fall Semester, 2016
1. The gadget in the textbook has a nice property which is that if the cycle enters through vertex [u
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 6
CS 535 Introduction to Algorithms
Fall Semester, 2016
Solution:
1. If m log n, we can always use binary search to determine d in O(log n) time. However in t
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 5
Corrected
CS 535 Design and Analysis of Algorithms
Fall Semester, 2015
Solution:
1. According to the lecture notes, we rebuild the subtree by a divide-and-c
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 8
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Solution:
1. For rational capacities, we can multiply all the rational capacities by the diviso
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 10
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Solution:
1. If the next character a matches, then we have one more match and hence (q, a) = q
Illinois Institute of Technology
Department of Computer Science
Homework Assignment 3
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Due: Thursday, September 15, 2016
Remember the Honesty Pledge!
1. Do problem 17.3-3 on page 462 of CLRS. (Hi
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 0
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Solution:
1. Integer 1 will be returned or the algorithm never stops.
Proof. We use induction o
Illinois Institute of Technology
Department of Computer Science
Homework Assignment 2
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Due: Thursday, September 8, 2016
Remember the Honesty Pledge!
The first two exercises explore the activity s
Illinois Institute of Technology
Department of Computer Science
Homework Assignment 1
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Due: Thursday, September 1, 2016
Remember the Honesty Pledge!
In the first two problems, express a dynamic p
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 1
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
Solution:
1. Let G(i, j) be the maximal amount of gold we can collect by moving
The recurrence
Illinois Institute of Technology
Department of Computer Science
Solutions to Homework Assignment 3
CS 535 Design and Analysis of Algorithms
Fall Semester, 2016
1. Denote Di as the heap after i-th operation, ni as the number P
of elements in Di , and di (x