0% found this document useful (0 votes)
96 views34 pages

DAA

DAA notes for exams and revision

Uploaded by

Ashutosh Karn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
96 views34 pages

DAA

DAA notes for exams and revision

Uploaded by

Ashutosh Karn
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 34
ee OO OOOO OTTO OTe Oe eee Re o * ca Adgorstomn in algorithm th a. Glnite ach af Aequenc= of ef which Ron amouar ef efforta in 1 Palggmranh oho be mane tn a Instron cade fa cluan. ricanitg Pevditian bapetianrcapmerie) faite piste “ings of Umer Innpty. 9 program on We Nee enters on infinie. Loop at arepe. tret ws fin egerdaen ip Raich fe be tarmac tb fim OG a i Ue Rare bol ae Conouds cuspid fn inate of tH preblinn conser of lapar neadeck 40 compute Ce mate cueto ieee es peer fin ofgerstton can be used 2° Adwe edmroat ones be Fey comple genatic: prabien, ronsginge pica pore Jeoye omtuar of debe, gray thremile pelea Hetrices of. cath. aiff Hilla ef prebium, bequants of for, volute, do volute, & loop tonatruchs Rove \ndas tonairued 1G, een ee Syerlood PD indicated thor Multipte. auingenento 1b 0 Vesvalotes auc ob 15) Pray, cman cre aut by Wade ltt ora rapresenkd 4 Rone exe OIE) eS 4p. vere Motoon s 57 1 ead fe Wndleate Hue marge Of Vatinen lin an ermey. fers er AL}. 3) hs Lovoset, ce Vrets GD> z ao [tet — ati. ea} ea pode £9. Poramabins ane fos to procedune by vate: qovOntie. be | Poeude code NG ona Myosin areead Jnr ention — sore (A) form, J<—2 to Seyi [AD do Key <— AC) Dieu ALI) ted dquine ACI -4) te js wlute 020 and ACT > tag, do Alias — ACD ) Ce Alititye Keay 5 6 pa aaa [3] I¢ e =6 A 9 ee Gee ae ry te ag => doh inaler) ote Keg BR or cic 242 oie tonctition 1% C170 mh pcade 572) Han we nor, wit FIs Chang ACL By alsd t=0 a Theo > c . Volar tag with be atone iho itd Cpu be tonednahd: ond pacucto Ceds—fom Selbesion bubbte Zor aig onion Qe wont & ® © Setieson Dont Binchuccte, 6shetloh > H#inctucte, Cwnio. h? Vols Cadenionaenh Cina hoan tame, votd pranity Jinn lat) t = we atid, 1%, Pra Creuse low many number Seant ("%d", 26°; prt (Sewer He climants Inme Heae Oy & 3 foe Cite y tens tt) 5 sean C8 a £ ACID, 3 Selection sone CA. 9); print CP Asma. often senttgr * yy ee) pug cena, AGI): A Meee imsucctierbers Cit BCD, Eo e we 105 Fein oy 1 <5 u ter) Peepers em pio Xe cacca> 0G) ) € jar tmp =A FI), Agiae ALS), Aci = ie) GO Arotysie_os soot © @ > “re cnet Bagorinm we Aer te DH FolLoualy hse Wy? « © & 4) Randy, Time BPs Running. ire aeareport eR Tay taper: of primitive openers Br yo tbe ee woah op exeturty UN dine /dtep. OF OF oat Coding ott) Ci'> (out. tees arep>) Coat of en pamnustor 9 atgorstnm 2) Inpur 3g¢ BE! nok, Sere a Hered Aven on eD at a Sy A, Peo ee ha oioniae? comet omaaa : rvoteirion fo Seapnenend: tae 1A Anetysro Of ansernion Serie atgorste Preudo coda? Fesension omy (A) <2 sang 093 4. oa 9 3 Berita ALES) IO dorted Anquan AU ta2 oy “ ees af Meat coms? PTO > He do AC esd acid tots a z Apasl< Ky apa ah ae ON toop we erecuted for gr" j: pene acopuie ort ior aaa Maat baa nee acca Runny fee oF etgorm ie 20m of sunny, He Of sm . emecared) Runelg, ancpedeaglo a Mea, Lo te ingur size} a= on cotn-) + cate) * ay (nav) * os CK) 4 at 2,54 -3) * aks 9 + cet) a) ae Bess cape re > fed > Hy ATID < uy tn ee oe ant Pong tee eaten 9a an >) aie OOF Gls OF Cy in) es Grd) * een -£) ace CA £) ce (nd) EC iA ea Ceai ie son cob 0-2) acy (rz) + ee(o-1) Be Cece ace 2 cates qres tee = (eeepc eae os orc) a Brose seen A Worst cose a a a . 5 4 an wore COM ey ena ype Ay = Gs GL )* cy le) * CDs i ico ; a Sem oes patty Fy. Ved ant ye x Ten) = cm * GEO #4 Cmte Cy (MOM), cy (a) eee eee grin Ce aay Ns ney Tu) os Ce Ne Tony = (Lot Sr Byars Coreners coe +a eceda = Carats + oe xe) ey iF @,b, Cane comiterr ond clupencls “por eqc(8) wo @ quadratic, aquahion art it le ate function aresemue corr OF og ) O> Show thar He nunnig. time wo xi oy Inpantion Somh Be tore Coma ell et Designing an aigorsinm Tune an many wag $0 tay on algorithm, 3+ Ancnamontas oppreach, i oI MEER Ecc, pice Goe—atona ip omdin, Or oe o Sime. Fon Eee tecse dineeien Aon Wecweagss Vik ttle approach. 3 ities fort pac + Gack tarmac “aonned POaHOD Portiotty sensed slab Thse proces |e maptated iL ot He elements ome, Aorded: Boma ant? 2, Divi. and Conquer Appmech — > “Ws ayprecth brats the problem late suo probisms tho! om Divilan. do origina probes bur pmottin In alge, Soe Jae Sub problim mucumaively On Haan combina Haas Solution, fo cute, Hu solution of original prublim. exampses quiuc - Dont ond tage Sond. TIN ute pare Gwe Fo Posse 2h spe Chenale te Inginttg)) ee new ple sg, terge tee tons bate ae ee eC ee onympsone? peaiyse: oa eS Ha mous, Assgmpror 1 ee Continousty epprondrin o cunve eo nue Mento dp Twa onatysig 1 contenrud vette Baus Hees Monngy BGAN incranecs (eslb tus sige, > of eo mer aanm coe alge She lnpe_Weuows vettwour bound. Hime Of an nee §y An atgoritm that le oagympteticalily, more effiuant wilt Lea toe but choir. Arepjmproric. Motetions 4. uta. Noresion (8) STF No chgind co Oo Huta. for a gen function br gin). tee ond Biaac))yiaiceginct |o8 Subs teeth eer exiny co postive constant G #e2 ond mmo, SH nent FEN)? FL ee Grey eonstonr 6¢Ge 4 7D Og) = rea 02 ¢c1gtn se flr) Ha Gb) Baa ia) 4 y oscar) =F) \ { pend 28) = 1 4m) €& OI rasa wate (3%) ° postive, tonston™ 4 fe Sue Hrd: wn i em eps.) roe epee SrerceabutgterSty tase ae Uip sles): <= 4 © Reman ae oy fe) 6 OG) ae os fon = OG): en ey Og ee eat Lear) One es weniber, fin) € OCgCai) Must be Aone mY 3 be mane migonues Got e~ Gopal late OG) & (nr) Murr etd dong = Be 3a am > Oy tan datinon Rene: Poe Renae eu Restore cl mienenng cM RRS uci gtd, 79) & ergo) an >No s A ileihimauetg, game A al dare more To ahews he Gee Mo Sut thor of acnt & tee 2 eyn> at N2No Can ite eg) mm e ~e cases wns! (for) : iene mao 2 Cx No=F z al aE iM no=e To Wold We Innguotitg. ond. upper BO fore Se “ deus choy Gs hy» poaitive, Hus Wen gor 2 we Byor _roteter (9) ncevegs eee sputter in eee OeU ah see eee 2 ie arcade areas Cl cen sagat asp So wre. igo Motesion Cryity, bound) \ ee a ea lacs if fon given function 3°), Oger) (eigen of gerd)2 tenet os prune, exlotd @- peattive opitede 6 ondultie, Such totais Sono ea oe Jo) Za aujemietr cod OGm) - we SUL Het o£ Fun) 2g) adn, ety) 40) , fear (em) My os Remark 0 (gen) BEE cies) 10 pooper oubse of 8 (yen) £ Ot”? Omege_reration (er) a te don gian Fonuton 90, Seeset) . Quy Constante © ond an tye) = 4m) Ze fg sede HOE on De omage, meteton peur, eee pounce, tn) = yo) Crguiry. finde PEGI for. any two fandions fin) and gin), wwe Rove Find = OCyemd) ond ory CH) fenn = OG tI) art FOrP= 2 Ger) (= GRE) a) CoG kt) ees O > Gor riygen equati) 9 £0) 2a) mea > (gor Het Veaguatiy) 3 egtn) £ $m) < cA o A288 Qecoree on proparg eg AEB, BEA DF 5 Smott biol _Notesion (oe) > pitas big (0) netoston Keay ok Mey fot be oroymptoncatty taht Femererapia2) 2n> = O(n?) > Wo Orympreteaty tie ans OCF) + bua moynot Om grep ton catty Hye re cot “We, pms bigse Co) nctaiton cymes oppor bound be ensymproncadig, yet 3b 1 defined o> fen) Fa te wnstent © and Boa he Sud ther OL Flay Se gir) FP fore trample: t= 2n = on) Smash omeg a Notesrion Co) > Th bh vel to Aenote Souer bound trad Us Not omymproHatty Gur, ak Ne Ca fincl oa t Fon) fo Gve) Content © and 2G) « . Bere cal Hehe ety & pny 4 M7Me Ramon = Mong oft onyonprone fore orompte ghia Gens) a 2a) ee meloren propenes Of mal Number app. exaiaenctian Aye tm pom oe aprons anal 2) Trancituty— #98 8 De 4 rac tars 6 Gm) ged = @ Chery) an, fon) = e Choy) a Raftex wiry > ALS BHA 5 A=B Finy= & Cem) toy = © Chen) stay = Ceny) 3) Symenh gony 2 8 C gem) ME gin) 8 Cer) Pe Siemon, fiye 8 Cem), gtr) = & Geom 4d = © nz0 298d ln Ace Ondieg. fo fbonacd suv, fed Hels frontedoen Pues his eeteo.> 2 companions 0 welt, Arsune trad plea - FON) nck gn) oon He abate dn dant doen A Anes t fc tS Now, we pur ttn) = wa TL get + 2 Chomegmnous saunveion) aor (ate mos) 2° i A to eee = Pees Sinaia Hew te Sog™ in dae ant +qm" fn = gn + Ge” fa = Sims Me 7 (ky 4nzO and aro es ep Qe 4 os Ute Se ae ek & cn Ee os bg ey A onet 8 Ga = Ore ($e) + as pus He value of ) 22 In eg. © fn = Sones + (ep Se3” of a. porHuter. proltem, Ris 0 ® Recursion of tryony ous. Bl? lone (ater Gr dase erat defor use aosnae PECUESOSD ecumroive. functon (0 more tan Later yratnuctton that usd dtack or neagioren. Reeursoive. cletinrion of Givicte cnc Conquan Teeaniq ut 1 ned slits)! = We at Om) +n ad, -ne2 mato recwl on Tin) = at Cry)t ftn) > Cost oF tonqucn TA Au: of Ste probtions: eee eee VEE VSSCSCSCOSCSCSHCSESCEREEEEEEC ES ¥ Kz0 De a ire coed tae ae © (1,2, 20 % MK Ip integra poses of Gu. THO mates Weds Grey ae = ar(a)t ? Tg) = ae 1% 40 = 22 .-—— ata) = 27 (M2) +9 eee tne Bey aeutiaattee tenn) te). = ato Ma)e rd Bee ergae faye RtCsy ar eee Wisi eee ieee XM Time comptizity Of ony pamhcuten probsim —> tn) Recursive definition of binay Beanth u Gn On) = Tye) ei) Nt) N22" rn ena 3) x e nea” €: TG), TAD Tes)= ar (nis) 4 aGys atau 3 Tay = 2x TO3D4I Ta) = ax3et 2H tf oT ea: dieeoerecances C £4) towns floan ond an auigper cee of on eqtatty Heh clusebe tee fenwren 1 value on -omoutin puta, in Reuroolve. Merrametea olatiaition = o] Tin OT6en/ed + fen 5 J) — $y nos claro Od cea tetas tice, a MRie Ua arre ran ene findéo ee Omynptohealy positive function, Recunrsion are poive by 3 Matwods IK Sb Substitution Mansel 2) Racursnive tH 3. Masten rete ol. 1) Sthotitusion tamod! SubsHturen rutool user incuurton to apace! the, meeterenee. su tinasion- 2) Recumsoion True Marnod : Ratunsrion gras, Mithool conver ucumnentes iho dus, whose Merete Ned Tuprerent Coat Bias got various SBGek opi recineelony 3) Hester rts Tin) @ ATM/b) + ftn) fa ai, ber, fend dm asoympien & pooitive. puncHons«) eyco ea eas, (*/s), +". n>) « az3 Me TC) > Liz js Pons t ened FRA = cet of am ee saa Fes} = -2 « « Ineegere So e e~ =~ Font To Dove O recurrent by Moston ee fetes ty be constdend: oa i const He fenye O Cntee® -€) Hero Haan, Ha. S01” an) = 8 Cn*e% ) Oe -Selve He semana TONI= WT Crd tH Compariy. wit rtandand equcten ep Master rte than, Tiny = & TC r/o) t $n) aay Temes finda n heaue omen => 0 4 finp £ eger) find = Otn)) So now, ftny & ¢ rere iilear ae Jnsquouky meat Cota Hen, Core Lb appleabi. Hina Ha sob" lo sinre G (ator) Qu Tinde AT (HA) TH We howe TONY = A Thrver +t Fin) dae, a= 4, bee Ftnr=3 Rao ames =) *% fone bigs stororion > 0 £ find 4 (gins) oe, tiny & OC nF) are ge a i ad wer 0 & 7 cee 4g Peete Garis) hk fenu Ha Sod, to WY Pages: ne iil rtm = & Cr) Pon, Tin = 27 Cn) +n t) ai) Binds n eo eo n biger orewton > #02 Ggtn) & pie em OnQnth es oo a ener) Z ee y gh me ven = eso due Mequellty usonlh told. Han coserd lo nob oppcnbes. On. aC) protease eae) tei > Toys tC Vs) a2 Gat oe fn=t ita, 1 ee 2S tee Be nie se ig astarion = eno) (ne g0 y ark poy 1. aoe (ane 50 . wo eee oi v Wp Lait not Rodd, Hin. cared te cor rede pore Ty Hn) 26 (nie ote qs sol" ty [roe & (8? say.) B gis Ager oun In bancenr 2 gon) & ager) | ee ef er te) 4 nds - e we Blume pings O-Cyin), “eel Shows Fens € 9) t fens 4 deg me mucunena TUN) UTC EM/a) 4 5? 112) {pasa Solve. asu bee fmnyan® we og ca a 7 rs ean) ise eG Eta) = J- aot mre ye ne eotate, oro HaX Secor) | Peas ee i so” * Foes, ee log) fot & hey Pye) ce ere es) Bue Tina + C28) + 2 Tn) = + CA/s,,) ++ ee 3/8 et E foye eg ates of wa nas fenye od. 0 8t een Lae Hana Hu Se Come 2 10 oppaleotosa , So th gen) = & Cn tog sn) gm = & Ci 403.9) ToD = acu Ca) caer aea bey Foye 2 F 5 pe Sea a leon gon Coan Yyger te netenon = wee gon) 2 4, ee B30 den) & © 9m) ware fen St ah er0 Ieaquesey mune todas, FRE ONC RE Sy Biss So Hus, so” Gos © Cn — dae Tends % TC 7/3) +> ase = 3 funy = 27 cut Waal ars ee a Bones $2 ne ne come 2. la appitcobte,, Hance He sop — Tin) =6LnP! doy,n) —— Ty = 4 thru) © o> a= be tn 20 hogy? de. rs gee e FOr) = ape a) 23e PEE cans? iomcos- oppure fon cona-L, Pepi. pitass” BE Cone-3 fade (reas) fe SS mbrae iy, Some AF) Sete | eer. — 0 Lk Jugwanty, tonauton. Mun Hue Bak” Jat [Fee Oe Seer Hee 4 bes oe 2 oe Omega. ctatineon —> meen Thr) rer) 9h M/s) 4 0° fend = © 265 (n) & fen) fend 2 egtnd oad er Se eee sot a wrte S Thin Wequatiiy ust Bold a3z Can") eso Fon 2" conciton, Ceourlewnait ts run) Ca) N27) ae Gea oh 2 & 'ftn) $ Zen 3 tonal” Wa due. Beate eta ceber pat sO ae eat Toys 0) Be reo een) > hig aes bed EOIN P 2 of wae em sn gon) 2 cgi) aan = ne | epe THe Maguay muse fold, aleg a = Fina cont” be true. Jagy 3 + a aD +) py BRS Ouse 2 FfEr/o) as ugar Hinw, to soi” te +n) = & Catagn) ons spi) = 16 CE = ania: be 4 fours n> ne tay one Setletian - He fat" ruguian ty. wonotiHon do tras, hance, Fiat erent Ou Tue a Thad + nbn. Ng Gn Hy Med wee 4 pecan), voters each rw rapmasnie Mae Gast of shoyee gulp probtam fe tue fue Hea, tanh, mltiin sata dan of eae [4s Obtain 0 aah Of pen Suv toot Ane Hun we cum up vas tua. por BR coor to catennine toe toot Of ott Lets eee oe Oc Seve Hie Turence me umesion Fras Mettedt Seo bere ane) + & to) Ten) = a tlV/e)e gerd TH) = BTCH/IW) A e238 be NM fee The dotution cpend upon te Cor) Onl Hie pollo opera. upon Ha. Cr/b) au thn) = LETCni)i + Ot) ar hap tp eb i eee pA aa. i tags = tag, sagt = 2 Ere tet ema Reirediy mxoscldiS Jog. Total ac. of nectar ot feat duet = 3 s < 3ueu Wet coat ef nokta ob bat twat = Tetet ne: af note x Coal of ene nocth a te» TC) > oo " gett One) oe Forel. war = ren bap car + Lag coer & (= OFL+ 245. ates) oD) > Tha) = Cre + Btn + (ie ibotamier ce)? te ie s ae? Ce ae ae (By (BF 4&0 p) Gus Ou) tay = 3t Cre) +7 Chose. of voovalohe © eayes af vortoble. ar uo tOKA a prDLEm for. dotuig, wwe Teenrone. au) = at Ca ) + dog Dh eter Riese: mtn) = 2T Gn) +899 panera) eas Jeg 2 = tage 27 Ton) = ar (v4) agn any 2 ar Ca) % ten? Pen erat poe we pur = + T (2% ) = slwi2) stm) < 25 (mb) tm aa 2, B22, fim) =m Akg, = mtyi2 Som fim) =m tard ta) 2e +g) conned ftw) © Cm? 3) eft) Seema =e gore TMareforn, core ® I appticohte, tow! tre@ nah appiicobta. OE eT A eg x 2 Bagh 26 J- Pees te a £8 = pater given LES Complirity In place Porn tecluniquit ondim. 12 0 tesa Boo je on 4 the > compeexity ieee beap Cbiney.) dare stream Vo an anney afan objec teed CO be viewed oo neandy comptir . binary Pere gt so ip comp latety oes oth fevers exept pomibty Me ore OWL ly fitch from Sht Of to Ho pois det date. Con be. present Heap_ Propery. “Tane core, du00 super of Luap. S>) eiesoscuene) + A of path tte grustoe than ont equet 0! > ACpanard C19 & ALA @ oa Ne@ VO oS «So pore braa 7 = 2) Hin tap A Charan ey) 4 ALIT Sea oee bine eta Male sa Heap _ size Cal Hap ate = ner Of ehmanta in tae. tap ators wits a annoy. CAD Note} Rook of ma. tu to ATS) (indaxigg atemtgrom +) Om ALo arse ponent Supt onal shh” oe ae r porans~ |) yatpon ( Lif2)) aang Por A011) ratuan (21) wipe 8) surunn (ate) fou A [oI ea porn G) i pe eem aac! sy dupe Ci) Seat) sg Ci Ree? DCA Cai) Conntouscrt on OF me, a Max duap freom ta foitorsteg Mor et tey* \, 9, 6) Or 31° we ACfanant II > ALI) he inary. eee Oey, Conareeen 2) i cS 1 se oo a | a @. a Vee 6 oe 32 eee ae Bes & ©6 6 6 © © Pt Pied Gp RN Ot Conny Pro parry ~ einai) Peete? Reece or (ipncese Ene = Binary St A ®°O ieee fs el oa | toa Pe epee We, allways outate, from * ine alec ame aE asd to et tn tap bur tan Hen tee pia. 1 on bottom. ge oe wit bub tah 10 Oh dons because often contig ite tas plat at toot, Hem utergests eto” fi 2 % Lak, : \ © 4. 2 © © Pe see eee S Cor RCCL. Com! ue, ‘ thos ray volun Ord than ote mene 4 stetate: fo uensls pred eUmueron pene © SS 4S ~ SK ~@ P| ee mi £02 Bob © ee ee aeiaies oR Sata 2). oe Seta, Aretyoin of tung somr Hew fore Combrurcton of tap and eee] e¢e 5 Heap cern equi ea satHen tne Tyas naquinech for Centimucrion af tune hoy tiger of Pras H Moy clap cavern of nm nett. ie upto the Hugh of tre asi = oh fog stnal) = tegals in RE Att tig op Chat tm for eentmuction of Cran Hu. Mor cteph tayenad 10 upro the detgue op. tas casrucrion Hein) = huge of tree ‘ Aucanateaat He PEs nee ie = = on x toga (ntt? = 0 Catagn) NE ino poreartime pecan sen: + © (ntogn) = stlms compleniby « Susut tn Rincon Hone Ramos eee Bee am fu tase neammety, meng Rene mepeamtcce ee ‘cans inp eeperage 8S 53 por willbe quick anck duae wr on fuap comm worst Core onslun to o(atosa) onux 0 (nD ctu » and Sunn corm, He Jo based onty an tenporeen etic catd compuriaan Serr a Se eS cL eurued ont F ee nae rane ACO Rereet Ba gee ae cen, Hen couniiy cen pune On) Hwy, jer ve cum Teer inpur on mney ALO] ena tree PEQUIRE fe Stu, ft . ~ Ra Gigi CAdie pee ni] so tote corbect ouspusr CL... ic) f Pee da te er ea Preuclo ‘Creda. Faye counriny. Sort Br) Gunty.-aonr CF, OO ‘ do ed) <° do Ss CD ay Ser Ee fos cone fangs CD ‘ numer of emits BP cliy new concen equat to 4. for. tet foe K do , Gate ne eo Cray Peon i & Aimgthe [A] coron to 4 a do a aferacju) < Ae) eragiy @ © faci) = — se = ee a oe Reifton We er ea are ee 2 3 % c Bie var qreax or aide He eee Deieen ation a ot) fet Thnd. bho! Founm bloat tier nad 2 Pee eee tos Seqanse bhood. forer — 0 (n) ao 4 Reon Sort ‘A es fe. paar > ee Jo nou eee een leaned, uate ae a ayo oe ac aes nes = Be vecnte o> fortes’ pam oti? 4) Fino. ou po) op numben ey Her gt bee ene Af Dyce eo RMN tia opiate? aot pigriticen= est) treat sau. noprendiet > Ou2 sour HAL gan Gat Of rem in Gitpuotaneet oF Abn ,oblW, ae o re satt anmn I Pem Suan Ny edly So Coo a | % eee aes eae a 4 ee late See abo \o ab ui obN i 4 Hants forte ay = D DS Somp Hea fottousivy Pet, Coww , ANGLO, BALG , RA, L Poeudea Goce for. Rooix Som = = aay = L Goo ae! “ts

You might also like