
CPSC 5115 Algorithm Analysis and Design
Homework Set 1 Due Wednesday, September 22, 2004
DON’T DO ANY WORK OR PUT ANSWERS ON THIS SHEET OF PAPER.
JUSTIFY ALL OF YOUR ANSWERS BY SHOWING YOUR WORK.
1. Solve the following recursions
a) T(n) = 3T(n/27) + n3.
b) T(n) = 3T(n/27) + n2.
a) T(n) = 3T(n/27) + n + 15.
2. Find the time complexity of the following functions.
a) T(N) = 2T(N/4) + 7N
b) T(N) = 8T(N/2) + 3N2 + 5N + 6
c) T(N) = 9T(N/3)
3. What is the time complexity for the following procedure?
Express as a function of n.
for (int i = 0; i < n; i++)
for (int j = 0; j < n; j++)
{ a[i][j] = 0 ;
for (int k = 0; k < n; k++)
a[i][j] = a[i][j] + b[i][k] * c[k][j] ;
}