CS344: HW1
February 2, 2016
Out Feb 2, Due Feb 11. Hand it to your TAs at the beginning of the recitation. No late homeworks
please.
Sort these functions in asymptotic order as precisely as possible (for example, use o when applicable
and when applicabl

CS344: lect 8
S. Muthukrishnan
February 11, 2016
LAST LECTURE:
Dynamic Programming.
Dene edit distance e(S, T ) between strings S and T to be the minimum character deletes, inserts and
switches needed to convert S to T . Problem: Given S and T , nd the

CS344: lect 6
S. Muthukrishnan
February 4, 2016
LAST LECTURE:
guess and verify method to solving T (n) = 2T (n/2) + n.
Find the median element in A[1, . . . , n]. In worst case O(n) time. CLRS pages 220222.
THIS LECTURE:
Learn divide and conquer techni

CS344: lect 7
S. Muthukrishnan
February 9, 2016
LAST LECTURE:
Learn divide and conquer technique.
Multiply 2 numbers A and B of n bits each. Trivial algorithm takes O(n2 ) time. Divide and conquer
takes O(nlog2 3 ).
Read how to do this for matrix multi

CS344: lect 2
S. Muthukrishnan
January 21, 2016
LAST LECTURE:
Example of binary search, max. How to specify a problem. How to model an algorithm and get worst
case running times (maxIn TA (In ). Asymptotics.
Function f = O(g) if there exists constants c

CS344: lect 4
S. Muthukrishnan
January 30, 2016
LAST LECTURE:
Mergesort.
Bin/Radix Sort
THIS LECTURE:
Solving recurrence:
T (n) = 2T (n 1) + 2n
Divide both sides by 2n , put g(n) = T (n)/2n and we get g(n) = g(n1)+1 which solves to g(n) = O(n).
Thus, T

CS344: lect 5
S. Muthukrishnan
February 2, 2016
LAST LECTURE:
Solving recurrence:
T (n) = 2T (n 1) + 2n
Divide both sides by 2n , put g(n) = T (n)/2n and solve to T (n) = O(2n n).
Solving recurrence:
T (n) = T (n/3) + T (n/5) + n
Replace by T (n) 2T (n/

CS344: HW2
February 9, 2016
Out Feb 9, Due Feb 18 (thurs recite) or Feb 23 (tues recite). Hand it to your TAs at the beginning of
the recitation. No late homeworks please.
Design and analyze an algorithm to multiply 2 numbers A and B, each n bits longs,

CS344: lect 9
S. Muthukrishnan
February 16, 2016
REMINDER: Midterm exam on March 10, Thursday.
LAST LECTURE:
Dynamic Programming. Knapsack problem. Partitioning problem.
THIS LECTURE:
Hashing.
Prob background.
favorable no of outcomes
total no of outco