Recursion
sorting
Linkedhis t
Trees BT BST BBST Segment trees
Backtracking
Dynamic
Programming
Graphs
Recursion function calling itself
of the
instance same
using smaller
solving a problem problem2
Subproblem
T NT TM
Sum N 172 3t 4 t 54
I N
sum m
IND
seem
H sum N
calculate and return scum of M naturalno s
Assumption
3 6
M 1 return ti Balecondition sum
27
I
if sum 16
calculate
return sum N D TM Sum My
andreturn sum of
mainlogic
natural no s
K1
Recution
3 steps of writing does Assume have faith that it willdy
Decide what your function
D Assumption
subproblem
2 Main Login Solving assumption using
3 Base condition when to stop
3 3 2 1 6
11 fasten f it calculates M and returns it ypsyaja.at
2 Raselondition
Assumption Girona
o return l
111N
if1N
I
2
man 1AM 2
manage my faction
I return MA fact MT y 3 2 0
3 y y 73 2 0
T.ci
Ifthek2
we will do
hecursiontraciy
fibonacci series Melo
1 My my my
10
3 7 5 6 7 8 9
U I 2
8 73 21 39 55
0 1 I 2 3 5
intfiblM calculates and returns the Mthfibnaainumbes
Assumption GivenM
D X
fib Fiblatfibl
17 v
fibla
fibliltfiblo
Me 1 returnal
if
M 2
Mainlogic return fib Mt tfib
Sum In e
t
Mel return
if M 1 The
1 return seem
y
samey
Firmin
mine2
Is Sum 2
It
1 3
int fiblme
Mel return as
if
1 mtum EIIHgI .i
Fib a
first
fib l
subproblems
This is called overlapping called Dynamic
optimise it using a technique
programming
0 Methods subproblem
I n2
TCN am I am t a
power ca if plt.p
Assumption Calculate and return a top
a top ftp.tatlip a m
power
if neo returns
return power Cain tip
a
P P Ten I TIN H
Recurrence
TCM TINT I relation
To I
ate a Aa a top
at as a as if In is even
ant tp p p
ab a as lank top
all z
que
a as a as A a
ant t.pl op4atopD.fo.pi
ant top
912 ab a al
al at a aft a
109 109
1018 my
1 long int int 2027
overflow
109 49 69
int int int
1 long
numbers
multiplying 2
So ththet after
M 2TKM 2 TI T I
1
TCM o
wa catnip T1 11 1
o return Ii iffnel return atop
if ne
8 e
ut 22
if 1
I return
tan 1171
1 TIM 2
else
top
I mtwmccggp cgmltpat.pl
1
Methods TCM TCM 2
power
Cain pT Ifasteaponentiation
o returns
it n
Cainta p
longy power
f2 ok
if n
5
11317 1
I mm
Eid
an A atop p
1 return Gary top
Method 2 Methods
Method's
f 1
Substitution method
7101 1
11 TCM TIN D TI
2
TIME TC 21
TINTIN 2 1
TCN 3 3
3 TI TIN
TIN ETCH
2 Ten 4 Ty
s TM
TCM 3 TIN 4 TI
intimes
k generalisedexp
Tin In yegg
7101 1
0
7107 1
N TITTA N 19
TCM Mtl
IKI
TINTIN
T.ca QIN
0 N
Eigg f 0114
A fact lays Recurrence
Relation
1 returns 1
item TCM IT TIN D TC77
y
return mayancas N
T.ee 0
ge o M
11 powchlainip Mal
I TI TO1 1
N TIM
TCM OCM
methods
11 power lamp
271M 2 TI
TCA IT Colt
H
T MILK 2T M1 T1
TN 212TH y TJ I
122 1
YT ally 13 2271 122
TINY 271 1187 1
TCM Y 2T MOHIT
1123 1 23 1
87 7 23
418
Tt
TCM81 2 1 416 1 TCM 812T MA TI
15 24 1
16T N 16 2171424
to
ntitiI
geol l
M 219 0 Not possible
741 1
A 2k
N 2K 1
7
on bothsides
Takelogs
I 2
log
242Mt 412192N T2 began
TCM
Inayat
NATIN I
2N 1
TINI M
T.COM S.c OlK
of6yaN
1 Methods 2
TIN 9 T2 TCM 24
TINK T M2 TI TCM
TIM 4 TCM 8 TI
TIN 2 TCM 9 TI
3 TCM237 3
TM TIM 8
TIM 8 TCM 167T I
TCM TCM IG T Y T NYU TY
7111 1
1Timk KM Mak I k Man
M
IN THA M
TCM Megan
M
T.ca D H
SC Olly M
TE
LTCM 1 t I
TC
TIM
TCM 2t ay any
TN TCM 1 TIN 27 TOLD
Aunts
Sify will
Recursions
Friday It
Il hewntheskillof
Adj 99ft
ASAHI start
te whydidyou
And Goodinginterviews
mq
a
Mechanical
codicil
y Biomedical Googhfntonien
117
pineta Swt
G performgood ininterviews
Genta Giggs
MLDprep
Ey aswell
II