The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
0 votes
61 views

HOW ARE C1,C2 VALUES CALCULATED ? 

asked in Algorithms by Loyal (3.7k points) | 61 views

1 Answer

+2 votes
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
answered by Veteran (27.6k points)
edited


Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

29,006 questions
36,838 answers
91,329 comments
34,718 users