CSIS0250A Design and Analysis of Algorithms
Assignment 1
Due Date: February 11, 2010, 11:59 pm
Question 1. (10%)
Solve the following recurrence relations (i.e., find out what is
T
(
n
), using big
O
notation). You are required to show the results as well as the
solving steps:
1.
T
(
n
) = 2
T
(
n/
3) + 1
2.
T
(
n
) = 5
T
(
n/
4) +
n
3.
T
(
n
) = 7
T
(
n/
7) +
n
4.
T
(
n
) = 9
T
(
n/
3) +
n
2
5.
T
(
n
) = 8
T
(
n/
2) +
n
3
6.
T
(
n
) = 49
T
(
n/
25) +
n
3
/
2
7.
T
(
n
) =
T
(
n

1) + 2
8.
T
(
n
) = 2
T
(
n

1) + 1
9.
T
(
n
) =
T
(
√
n
) + 1.
10.
T
(
n
) = 2
T
(
√
n
) + 1
Note: The Master theorem may not be applicable in some cases.
Question 2. (15%)
Suppose you are choosing between the following three algo
rithms:
•
Algorithm
A
solves problems by dividing them into five subproblems of
half the size, recursively solving each subproblem, and then combining the
solution in linear time.
•
Algorithm
B
solves problems of size
n
by recursively solving two subprob
lems of size
n

1 and then combining the solutions in constant time.
•
Algorithm
C
solves problems of size
n
by dividing them into nine subprob
lems of size
n/
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview.
Sign up
to
access the rest of the document.
 Spring '10
 Chan
 Algorithms, Big O notation, following recurrence relations, closest pair, GaleShapley algorithm

Click to edit the document details