University of Asia Pacific
Department of Computer Science & Engineering
CSE 208: Algorithm Lab
Section: D2
Assignment - 1
Question 1: Derive the time complexity of the following code.
4
1. for (int i = n; i > 0; i /= 2)
2. for (int j = 0; j < i; j++)
3. printf(“*”);
Question 2. Show that the upper bound of time complexity of computing nCr (combination) is
O(n!)
Question 3. Solve the following recurrence relation using the iteration method.
T (n)=7 T (n−1)