You are on page 1of 5

Q Hi 5 1

white Sen

I
94
int
5 1 2 3 Ceti
5 Sti tD

j
me while Zen

pi
7560 4510 07 575 0 0
7
i 2 i 3 Ey i S
sin sense sammy
1 2 1 2 3 1 23 4 15
1 243 4 5

while Isen
X
s n

ktDg
on

17 1 n
312

K2 n

k In
It t t

it i I
fit log l
log n
log I

Mgmt log n

times
for lint jet jez jet

y
outer 1time inner time
run
f
K times run inner k times

n times

RECURSIVE PROGRAM TIME COMPLEXITY

Q factorial m

Bigger problem
1 Bigger problem
Smaller problem
2 Smaller Problem

3 as Bp 5 4 5
n1 CnD
fan ne funk ng

film D in n

tannin
m2
f n

Programmingfuf
int factorial Tcm
d int
n

Iy
4
int sp
MD
3 int bp.IE
ii an
return
by y
a

mathematical
operation
constant amount
Recursive Program Recurrence Relation 0
TC

100000 100000

T n 1

i
TG 2 t c
I
nequations
I

msI itieiia ncn


me
n
Th
Ign calculate time

n c e ti n

Fn at 91m

m c o m

Shortcut I Rec call

Ic done in i
fu frame

iL Time i n c

statory

Q Fibonacci Series

It Ea Ea E É6th e
4th
e
goth

Ite Video 7th no


calculate
recursive
Befits 4th fib no calculate
n y
no
3
sp 5th fin no

4th fib no
n na fibro cannot

foe m nth fib no


cod
fan m t n ith fib no

n ath fib no int acei int


fun n 2 n

intspitge
Wayt
int spa

1miShortcut
Recurrence
int
bp spitspa
Relatim
return
bp

You might also like