Vous êtes sur la page 1sur 2

1. Each problem is worth 5pts unless otherwise stated. Blank answers get 0 points.

a. Provide a concise definition of algorithm.


b. List five problem types solved using algorithms and provide a short description of
each.
c. What are the (nine) things to consider when solving problems with algorithms (and
let us not forget #10, because George Carlin says you have to have 10 items to be
official).
d. If an algorithm is (f(n)), then it is necessarily
e. List and provide a brief description of each algorithm analysis notation type (there
are five of them), state if they are asymptotically tight bounds or not.
f. (10 pts) Given the following recurrence relationships, identify the type of problem it
represents. If you feel a recurrence is does not fit a specific problem type, then
provide a brief explanation of why you believe this is so.
i. T(n) = T(sqrt(n)) + 1
ii. T(n) = 3T(n/12) + (n)
iii. T(n) = T(n/2) + 1
iv. T(n) = T(n-1) + o(n)
v. T(n) = 2T(sqrt(n)-1) + O(logn)
2. Recurrence, Proofs, and Math Stuff (50pts).
a. (15 pts) Let T(n) = 3T(n/3) + 5n. Compute T(n), i.e., solve the recurrence. If you can
not find a value for theta, then settle for a series that gives T(n).
b. (15 pts) Suppose you have a divide and conquer algorithm that divides a problem into
two sub problems of unequal size, such that the its recurrence equation is:
T(n) = T(n/2) + T(n/4) + 1
i. (5 pts) Draw a tree that shows the operation of the algorithm
ii. (10 pts) Can you find a tight bound (theta) on its running time? If not, can you
find the upper and lower bounds on the running time?
n 2 n 1
c. (10 pts) Prove by induction that: i
4
i 1
n

d. (10 pts) Evaluate the following summations:

1
i. (5 pts)
i 0 7

x 2
ii. (5 pts)
i 1 5

i 1

assume x2 < 5

Vous aimerez peut-être aussi