a. 1+3+5+7+ +999
b. 2+4+8+16+...+1024
c Σ+1
d. Σ"};
1. Σ–13+1g. Σ Σ -
e Σ"di( + 1)
Ξ
2. Find the order of growth of the following sums. Use the Θ(g(n)) notation with
the simplest function g(n) possible.
a. Σ"=(2+1)2
€ Σ=1 + 1)2-1
b. Σ={1gi2
d. Σ. Σ( + 3)/n4. Consider the following algorithm.
ALGORITHM Mystery (n)
//Input: A nonnegative integer n
S←0
for i ← 1 to n do
S+S+i*i
return S
a. What does this algorithm compute?
b. What is its basic operation?
c. How many times is the basic operation executed?
d. What is the efficiency class of this algorithm?
e. Suggest an improvement, or a better algorithm altogether, and indicate its
efficiency class. If you cannot do it, try to prove that, in fact, it cannot be
done.
Fig: 1
Fig: 2