3 Nov 2019

School

Department

Course

Professor

LECTURE23

Determing precise formulafees runningtime Fcn

is difficult

Simplify by using abig 0expression

0gcn is an upper bound on Fcn

PROPERTIES of big 0

Simplicity

fon 0cgCND

gcn is abig 0bound on fch

gnis simple if

It is asingle term AND yo

Coefficient is 1

ex sum 0

fees Ciao initt

for Cj Ojen jtt

sunt arr iCj

is fun aGnat CntCwhere

CCz tCz C2Cz and cCCz

het gcn cn't Cnt C

gnIna

g3 nn2

Then fCh a0cg CND for each il2,3

f0cg CI13

Note gga are not simple

g3 is simple

fe the running time is 0Cgs

CND

which is 0Cha

Tightness

we want the tightest big 0

bound we can prove If Fcn OCnD

then we cannot find afunc

thCn that grows at least as

fast as fcn but grows slowes

than gcn

gcn is tight bound on fcn if

fcn 0cgCND AND

If fCn Ohen then it is

also true that gcn OChCnD

ex 2Running time fees alg in exCD

Fcn NZ CntC

we had gz nzn2

Let goCh n3