47 views

HOW ARE C1,C2 VALUES CALCULATED ?

f(n) = $\Theta (g(n))$

if c1.g(n) $\leq$ f(n) $\leq$ c2.g(n)

f(n) =  $\frac{n^2}{2} - \frac{n}{2}$  and g(n) = $n^2$

f(n) $\leq$ 1.g(n)  as $\frac{n^2}{2} - \frac{n}{2}$ $\leq$ $n^2$, hence we have found C2 as 1.

now find C1 such as $C1.n^2$ $\leq$ $\frac{n^2}{2} - \frac{n}{2}$

As given in solution above C1 = $\frac{1}{5}$ will staisfy our condition