CS513: Homework 3 Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
February 28, 2011
1. A simple greedy algorithm that scans the array A from left to right is optimal. Starting from l0 = 0,
l
nd t
CS513: Homework 1 Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
February 28, 2011
1. The correct order is
2 log log n
n1000/ log n , 2
, log n, 0.001n3 , (n + 1)!, 22
n
+log n
n
, n 22 .
Here,
CS513: Homework 6 Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
April 29, 2011
1. The algorithm chooses a random vector r cfw_0, 1n , where each entry in r is chosen uniformly at
random to be 0
CS513: Homework 2 Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
March 10, 2011
1. Let (n) denote the number of primes before n. Then the number of primes in the interval [x, y ] is
(y ) (x). S
CS513: Homework 4 Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
March 21, 2011
1. The running times of Bellman-Ford (O(|V | |E |) and Floyd Warshall (O(|V |3 ) will not change due
to integer we
CS513: Homework 5 Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
March 17, 2011
1. The max-ow min-cut theorem states that in any graph, the size of a maximum (s, t)-ow equals the
size of the sma
CS513: Midterm Solutions
Instructor: S. Muthukrishnan, TA: D. Desai
April 28, 2011
1. (a) A naive implementation requires around 2n comparisons. The following procedure is better. We
will do compariso