Unit 1
Unit 1
=3at n tral nee
3(n) = AN
(T-0-1-932)
Venkatesh A. Bhandage
M.Tech, (CE)
Aset. Prot. Dept, of CSE
TCE, Gaoag Ge)
gne con farninl-do be sabshed 15 )
fin) 2 cx g9CR) for NZ
Brio 2 to hy m2 06 10 Hn m29
fam above yelahony C= 4, g(r))=p and M=2,
by dehinppens #00 = © Cgtny)
AO #n=O0(r)
LG Pg.
Debnibon s Big-—D isa meagiye 3 the leat amends hme
daten by the algnithey A complete ehercihan . let Hay) Be the|
dbme Complemty @ an algen'thn fre Feanttan Hn) iS
sal do be 619 omega § ln) which 3 denored yt
fin) = D&G) ;
thad-thoe ats a gesihve cnsant'clan non-newe
ees sabstying Ae conspcink .
ton)=c¥gtn) Ar all nZNo
6, fae dravo He graph Zr) and Cx9(n) vores 6, she
eynh 9 Hn) aie re g gin) 4 sufficiently
lov ue 9's she wi
. é -
4) given duncho
cgtn) lower bound .
ie d(n)26g(n) fall n2N——>
t
NoVenkatesh A. Bhandage
M.Tech, (CE)
Asst. Prof. Dept. of CSE
TCE, GADAG t7h3 ole (3)
(This nofahon gues the louxy bound ona Zanchon #(n) withio)
aansant fats. ne (ewry bound on Hn) indicates that
Funthon Ho) eit] contre atleast she speahedl ime oxy).
AP let Hn) = loont, Engress Ln) usar big-omesg ,
IM His given thats #(n) = loon+s .
fod glo): \erus empress. 9 (5) 19 terms 5 Aigher orcly
Hmg. Hind ap Ghoon below + :
gin) =#(n)
= on +5 ti
aaa Crophcing ‘6 with a)
Se, g(n)=l00n
The consol go be eessted © 3
don) = © gen? fr (M2
‘ {3 We 28
welon+s 2 WOO fdr nzo
Bris claro she above wlabone thal c=100, 900) =p
and m=0. ty dekniboN, #n)=SLCgcm) ,
x Le LM=DL Cn) |
153 0 (Big - theta)
peAniton : Big-@isa measure 9 the lear as ell ay ngeit
canned oN by a til tocanpléte. let An)
be the camplendy gan Lynittrn . The Lunchon An) 6
said 40 be big-rhe tag 9(n),clenoted
Hn) = OC gCn))
Such thak-there emits eme petitive cmipants ©1,Cy and -
rn—negabie inkgey No Sab ofyting the casramt,
PTOVenkatesh A. Bhandage
M.Tech, (CE)
Asst. Prof. Dept. of CSE
TCE, GADAG
¢ (33)
ci ¥4Cn) #(n) < Cox) forall n2ZNg
%, i wedraw the graph #(n), C1*gLO) and G»gCln) venus
n, the graph 9 #(n) Des above the yp c1eg¢n) and
les below the graph ¢- cot y(n) Ay suthdintly large value
4 a'as show below: ‘
dn)
ba) ugper'beund
Hn) owen fanedioo)
19Cn) Lower bound 5
N% Uy
used do conote both lower bound bumper —
ts
This notabod mJ usthin acon saad Aebyy
found ona fanchon t0
49 Ld Hn} = wont & » Enguers Fly) ting pig-thele .
Soluhons Tre constrain tabe sebrhed ier
| clegin) 4 fn) axgen) ay 026
. =e meate 4 born fr.02
ys cleay fos the above velaons that Cia @=10S |
Mm=190) =9.& By Lehi lD,
pend = O.C gla).
loo*e 1Venkatesh A. Bhandage
M.Tech, (C E)
Asch Prot. Dept. of CSE
TCE, GADAG Gw
pods Magic Fyssre_ |
piston: A crag Square is fag numbers Storecl i P-D |
guch thal the Sum jceme ys in each ww, clamn an
Lragiaal ave Bune. he sine g the 2-0 AMC mist be tl xl,
york be odd Dre so al. bore elements 7’ -D arrHY -)
mosebe We. .
cede sconsiday a Square marin
a (quer by Grete )d9 gener
LA Feupolicad 0)’ fal- the value’ athe middle borg the lop
e .
m-(er-He postion be Gy):
Li pow ihe fie bor and enove lebt-one, bore while mo
left #0e iricl thesquare's boundary,/her
oa . ‘oe Woe nideg the square. .le-Cr09 oD)
js whe pos AOD. : aS.
sof: 2P vale in the magic rpve ak (onjeal) iseonps Hho
Cj) < Cow, ol ). + Seon A gl
Shep 3s 2 aragicLn) cal) 15 Mo emphy,/hen aove olavor7
Papacy next yous by mnoremeniing 7° By 4: Sat
bile meving chun, Poe ge byond She pee boundlary, ther
fails Fe onthe ofporie side 9 the spate.
(seg 4.3 Fert next- higher number in magic squabect posit (yj
gs: pend Hath 2p | al abl the spac are le
| Pesign's: Ine detled deagn ah ve mocec! Net below s.
anipallzahor!s pssugne Teel to ‘3 2
ath W29, anidatly no elements
ave placed -ms ig» melicaded. int :
\
7 2
aliting the medi (6/05. 3
2, jit magicnacrg=f{o} wes 42]
32 9x5~ Ihe yules to be Hilo
he a magic Squaeae below:
ofe
e1o
a] 3
| >
gasVenkatesh A. Bhandage
M.Tech, (C ED
Asst. Prof, Dept. of CSE
ICE, GADAG 4
(ebalaahon F Apu pluie, mC 9
Feumber | ine addleg of |
Ww (ae Can plele any nukbey ‘
® Shaw here's
ig mnitial Valles: 120, j22 NES ,
18 §2Gdb=Cn/g
n.i20, 520-02 marae!
Seq Lt ne upulard movernent-Ts obfainedl. by subrachyag 4°
Fern t1/ 16, i-L)a#-the value "7-78 negabve,then cartier
@ boot on opposite Side the squsie bY s/hn9
sag. 26D = CO) 1 osheraite SHOW gosihan +o
| Thus opward aewvements obicinedl wligg saement :
lywoG-120) 7 Cn-1): Cit
lye left mcvemend iS ebicinedl hy -subsrachng | horn.
1G (GD. TAF WS megabve then corsidaya box gD ofpe|
se ide g the square by $eHiN9
Weg a(o2 @)
Otherusie, seb (ol posh do’ j= Mug, lett erovement 7S
given HY col =(j-140) 2 Ca-1) (G1) |»
az BL ynluein fhe erage square a Crow,col) 15 eangly, hen
Ch j Ko, col), fis iS achioued a3 At lows i
18, | £Caregyc Loi Leol| = =0
Afofofof op
: Is.
2
°
}
°
°
a} of 0} 2}
9} gh9 19} 0 |-
9} of a} 0] ow
Sig 3% Ini Mearene 1S objained by inoemenhng x
fy 3 idene by wins anod“operaH os) a4 chao beloco
= OPO) [Lemove chwnwarde,
%, jE ji ol Her canbe ob-Kinec! Sq canky
Hong sips & Sep as sree bes:V@RKGIESA aie eee
M. Teeb, (CE)
Asst. Prof. Dept. of CSE
TCE, GADAG (av
dl megiclwu\col| ==0) j=yww, j=l
ese ta CGH hos
Fastrt Zak gosto Ci,j) ie mre LALD=2. Barepeal AP 1 3,
Saserd ‘3\ ab posihoo (ij) iG magic LOLI=3 J repeal-sp ido}
‘ ( |
Sate 95 ab pean apis eagicl BL J each Sap PrOCeSS,
‘seat.’ al petition Cig igoragicl ok Ark=26 25
dr kar buen,
Generally fanchar loginerade mee guareTs ger by ¢
void oreGic. sqlare Cab meghe PY MAY-SI2E), iat O
{ fb Ljkww,cols 720, JRCn-Ns
magic LE D=U
fyCk=2; k2=a%n; EHD)
nf wwo=-t4o)! Ca: G1) Lup posi.
wl =Cj-1 4092 Card +Cp05 Y cebt pesitiooy.
if Coregic Liss\Ecoll==0) tx100, Jacels
else 12 CH) QS
5, oe CALIHk,
d
Funchon & pom 2-D anrey
void prwl-rradkria Cin aL ILI) wt 2)
{ iat hy
hy (i205 2) jb
f SEER yy mont('Iad" cic}
payee’) 3 4
ue PIOVenkatesh A. Bhandage
M.Tech. (CE)
Asst. Prof. Dept. of CSE
ICE, GADAG 2)
/(Pngrase 7 gerwrade reaps Fite.
thinclades sido h7
Hincadezstdlibh>
ddehne MaAt-SRE-\O
1/ Fatlide Aunchen by gnerahag regi Spare S punt 2D.
void main()
{int aegic LLAD= $04,
| pint Enver Seg Spat {o's
WL (n9=>0) rae
[ grinycomagic Suave oct not qutis]o); outlo);
Sn [Naz HOY-SS2£)
{ pl" org vange\o"); enit(o); J
ccandl'td\ Bnd:
nag ic_sguare (magic, ists 1D P4 10
A " 41 4 16 [ral 7 [s [23
puinip( "Ine anagle SPAN Sle Ne eae
gr arasnin (Aree. P74 3 pializ [io
3 AU 2425] 13 |
16> | peacracee COMPEXTITIES (1.8, whadis used rokry
me complorld
>| By canparing the me canpleodhes ¢ #00 alg cn thrns that
pardon she Same dash wecann derevdbare eohich alg onihen 18 -
beer.
&x; eb bme Carnglend fy opera P % OCr whore orders 4]
Ce bane cornplenhy gp programa 8 Blo?) whore ctolr if 2.
§ite the ordorg' pS less than ardor 9 ‘Qi the prograsp!
8 fesdey phar’,
sl ne pme Carper an algonthen is Mom cred.
a on) en h paits ‘pianay beo af AUG ow,
dhe behaviour g copier changes ascrcor 9 I? charges cg
Ds
thown %? ‘
) ie io Pio.44 Wt Runni dime iS hnexr,
be
Aq Ws Runa}
a
f\9!
| Wl tagons dined Sadorel Po gesthors ma atl per,
problems f |
Venkatesh A. Bhandage
M.Tech, (C E)
Asst. Prof. Dept. of CSE
+ ICE, GADAG
lon [nN [wleon [w® | w>
o ) eo 1 |
| 2 2 4 q
fe 2 | 4 3 6 | 64 6 zy
3 g Le 6q | S12 | 256 40820
4 | K 64 [ask |aorb| 65536 1 high
S | 32 LGO [4 768 | A914 9612-16 ae
woles fy camping’) ‘and Wa is obverved fomrriy aloe nbd
“thal oxp patrtal Aanchion groves voy fase even ty trol
vantabeng ‘when canpared nv’.
lls adit ghaf mincing Bere 9.4 pregrann 7s conga |
lg alt Yuvoms, be a prograan’s logan thnic leganithanic Aig ruori
ag Time occas 4 programs that solve Ae problem f
ii she poole sre 4° acasiay! fackyay ece
Hirahon 9 re log Coes nay earth ),
[egal + vuneing hare e ‘why. Ine dwvicle§ Grquar gor)
hans shay qhick sort, onerge sort ede All ( haverhis bere.
ame S qracdrabe, Tealgosthns normally wall
Fare 2 ( (cof: fo Magble sort, seledon sorb,d aragia addbin,
Ne: Fhaora re 5 cabic, Mill have 3lops Gi rrakix
[onclUiplic
Ms Runrang dmeg an algorsthrre agerenine, &: Alga
tha? gor NF subsas 2a. gwen Sth.
Cmokel ere. C tus frce technique
e70 |ms
=>
= be
Venkatesh A. Bhandage
MTech)
Asst. Prot. Dept. of CSE >
TCE, GADAG 44)
he grapi> Shouss plr ¢ varieus Hematite as Wy chaye}
4), 3 : =
hdumance Measurement? L
anks cnsidans how das? the algonthmn iS oxeceuted in our -
sae Ire mreaiuure 9. how fast an algaithn if ir
Ned on aspeute machinBand how ethical she sien i
luses the spate onthat mathine daning eeecehiarns
whnorane mreasanmend. Redomante measuyema-aith
wept to bine casi he objaned Wiig Wo mbhods,
Using clock Munch on.2 Mors Yunchar yelurns the anwuaty
——Gassor Aime that has elapsed inte the progranry begat)
Srecouing, where dpe iS clock-b, Totind the dime we ue
the clock funch 0 gute Nahe pregran? onteal : Sait ¢.
preeveatb onl 9 the event, ;
mne difference. puween Sap one and Harrame ges
He procestor Asn dy she acbvily co be ee Oe h
ve inls Seconds wk divick i+ by "Fhe # Cke por Secon |
is jceeobhedl using 1he Syanbel) ¢ conftant Aes FER SEC
Roya f A