0% found this document useful (0 votes)
20 views51 pages

Unit-1to9 GTUQuestion Answer

unite wise imp question

Uploaded by

Gentiyal Bhumi
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)
20 views51 pages

Unit-1to9 GTUQuestion Answer

unite wise imp question

Uploaded by

Gentiyal Bhumi
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/ 51
fo a HD oefire Alortihm. Dicuss Mey clawicteristics of eulgenithm, p= YW fa crf ce defn ComPdedional Parotedme dt dane » Sore wNeOS soy sebok tines aS dnfd tink Producel » Sore voud oy set of ves as olp. ¥ =) cheaeacteristics of Ayjssihen. , : Se y Danna: Aigorither shoud Juve 0 oy move ven define , sel Info, p ORES Aljoritin should June Lox move wel defre > oda. . pb ComPlit@ress» Algoaithm Should be ComPlé#e ts Yeonemde > jhe gute f dD > Cowpectmess 5- AYerithe, mast be CamPlit® oF Grpect hur » Bemeade He CoonG ovtrd- b ae ‘ j > Fini teness 3- Algeritin mst terminate after Prntte mrebes of Steps. , > Peastilitss fecstble with pe averteble Recowates. pao) ete a Sa Shee, I 19) gee . ‘ veh 9 Ceral is OF cilforithm ts Retuireel ? ( g " Fhe Comfidutional Complaxits of alga tts. reoint GF Hee storys 3% aie Ravounces neda fo CrrallYsis OF cm ligation Com help rs wodersttrel Ter: Oost ase, Aerage case, Bat case DEMIS OF HO Gordes 114 Bereauy Focused om fime VSHe , MMT suse dist UScge cic n/a \sage . = > but mosh Smporent clhout Gpy tire. —G Hist te spe af Algariijn => Simple Reaactve culforithn ae Backtoacking eUgooithe, => Divide cir Comnge auloarthor, > Wnewic — Progoeiew ~? Greely Aigerrtier, > Browch £ powel 41 > Geyer, $027 they, BAKE Rae DST Hho, —© ohut vector 9 chi) opeudion one pexfooel om Vee 9 =) A \ecton wears ee ion oF m—Hele of number U= (aye --- Un) Dui ose CH fhe ComPonents of SS fH cme fhe Wo ove zex0 2: Ne zex0 vector. > given vector ucind v ome Ffuacl. ty MVE dE See maker F ComPamPtS and iC Comespmin) ConPorets Efuat. uizo She wie Comes Valine cbse sac =) ara ee Pex faymedl tm verter. 2). Adiom of deo vectes. wsy = Gu, ue et (v2 --- Ym) = (14M) +M2 4¥2 4 =~ nt Ve) 2) multiplicadion of co vector bi o Scedkm, My =k Cujyye $85 = Rar Ra Kur, 3) Dot Poadser eek tor 2 ae PMR ae MV SCTCSCSCCSCtCsCvsesesessy oe Unit 22 « Crvumevical] * Arel} Counting Soot Pow the Poitening mites 4o Sow in e1scerdi ng grder: 4,1,3,4,3 “$40.13 eve ce Aowgy inclexing a: (2731773) eben oa 92 3 4 ¢ = (elz}esT a] Site 3 4 ae ee “ epeprion” tm allehavetiad oxo he [2] . fo ies . 5) aleto Tez To Tr Te) ') [aleloleTs|#]e|T Iv) j ; ie e 9 Pen iid Head Seat method 2 20,50,30, 95, Go, . ag bp ear AE py Poe uv ae » Fi wees Chk alles ? Fo ee # > 4 ge wen we ’ & 4 ry Fo Loree vv > 7 ; pac ee ney Ww » ee om Bee j f PO cheh ewe He bsic stees of ' On | tall Corning Soot 9 Sea} Derive MHS Hee Complexity in es ae Meese soe Dede etal nine PD Gries -1 ere SHEP go sI6P Explain. cw é Seite. => Tne oplexity in cos+ases- O(n) —O Aiscuss heasicese, avereye case cind coast C50 Hoe | j of Prick Soot. =) Qik Sa; = (Dividecind conqure) » p> aatcu Some AAS by paatitionns she crmeij ta be Se 1) cach Piatition 6 ‘PWewrst) cated vearsivey @ per cose C2) 5 «ee i s ocCus Chen RBAiTon Paodces Sub proble gi2? yp ie Ter) = 2702) PO (m) ous dre Pinng Hee derends on 4 55 balarced 0% \mbalemced. Tl) +TO(m) + Om) — Axtertsont (4, Po) ik P Amcvemet Tanc decsemot J ® p 20 lo e oF So ik P. a, eat J 7 Sel jem § @tore © 30 > 4 4 ny ° } J t —y mere § and deceemet 3 ) is 3 aeele 90 9 Ss: {G6 Gol ti op 4 wat oe 6.4 aw i we DP ca tog t stay Prom He beirning of the teible ae Ord of te Fable Asa oeult of ctth The leosets ej oil be Pased +o 'S Position. Pao@iuxe bubble CTLi~-n)) Cost Hoe. 5 4 i { C| 4 Pox 1€1 to m do Cc oh Ge 1-1 todo co. Bh Gai) 0 1059 > +483 C3 Bs my) 4 a at 1 igh ee a C03 73° Ch Fe (Gi) i Om / 4 q 4 4 4 ‘ 4 ‘ ‘ \ ‘ ‘ ! © Gest cave C2) SThe med ave elvedl Soxtel > Pty) se ae oe) Case Otte olen 4h cave iS yo veise sovted . eee & soxted., PhosPs-- 19 oR & 9 ut ESTs IEP TAS — cma iii CorPeresirg Om element t2 at HS M~till > cuppa Piaf é Pasi 479” Rom TS found HE Clem@d inserted, isert CT ri-—»]) Cost Hime For F< 1 to mde Cy ” ST 0 i a+) ce 1 a a-) ° eons by Insertion Cin = Clemeat ¥ $e Position. clusmeg euch THerdion ( 4 Brea ‘ ANC S>o od xe fli Jdeo cn Tlsad< 655 ce J es-) Le end TO&ay Analisis :- © geet case (-2) I The list 1S alvendy Seofel in this case the 1+ leet 1S Conte ony to 7-1 -Clemet Thus we have m1 Comfarisons . —> ot) @ hreosge cose Qe : £ j=2 Ts 8 Pees, 10 GF) =) Bemple z- tk eis 3s ee 2 ee > 3 is sod shiftin 4 ais bee 7" SHEP 2: Zand B ave —Smtd Shift 9 +0 9 4-36 4 2 wight het 6 i FY SHO 32 3, 6 tod. Bene std Sh+ 9,6 dnd 3 do $e Big sent 4 Bs Soo fo af GHP KE 1,3)6 ard 9 SoM SHEL S, Cornd 3 te the Aesert 2 Pe | | 356 448—->2 ‘i fete Le a7 vies Senteds” [1 To 13 Te Ja) se —O esenants ae § ? © =) ddecion Som cams 8 erent a selec aa a Boss} case (0) @ heraye cerse ¢ a O (x2) = O(m®) py as Yo Wy ery Mem se 3 a3 3s 4 NAY Le ee foot, eh 663 ar 8? heey jo 146 03 BS 27 ho 4, aie eee Jo ih WA a9 85 eS ere. ne Lj ‘ee. 27. 33 Se tis he corel [le] 4) 19) 27) ae] 35 [oe] es —@® Averwge cas > BAACHL, Gyoas} ca1SO =) veweye CrSe : (0) Dar iver Cale omeilyfis We Fike eth Powible imPut Cinch Cobtuote Coorfuting HeO far au 4 InPrct. S Fm ce FO Cabddated vawes and daide tha San a qoral mimeo 6F Tres. =) So ae Kim atl HO ces and o, =) dest Case 1(2) > dr NE WES Come omal¥5is GE CalClut® fewer boinc! Ke agerrning ge OF SO AGoritte, HQ onst Kroe fhe Case 4hat Cormises mimimyn ever of gtemtion fo 1 & Fecutel, dn Ae linear seearh agertthes Vs Case cicc ims Ben KIS Pree Tr the “First poet Coma sis . Wide AYO RO hy m4) —> cumct case (0) 2 —) dn Aye eovst Case amalisis ve Caldulate weper bord. oe Banir® Gimd GF cen ciQortthar. —S we ovst Vows Te Case qhab — ComseS cere yn ambh? OF ofeyation fo be ease Ox Caated —S Foy limee carmen - He wont Coe aren S then qe Cert t= be SemGdd & im the above dale ; qe mot PoBext > cee - in pyoyie _(Vo}ection Z e Re gece Nowkion 1S \SCh fo descoib? she wuming Here im cUiffosithen. O P Mokdion 3- Thaler notation Cerext sive ) ® O wotation 3- Big -onroteion Curves Bound CAtoest)) 9 1 D Deoration + Big dee. rotation (fover Yard Cat lecest))) ' ’ , ’ » ) DO B Cthere notation [tescet tre) (ane ones |) , —) Average Corse = } _S fox ot given Rerctom Bln) crotel bd OfgG) ne , cet of fection } 9 GO) = FF) rox (9D) Sf OG) bow , oh Mem gy > THs Metatlon GMS rn Suce orle of > ; om aitkm ct Consent fe 2 oe Cana , = ae HY Flr) = OCG) IF there exist Posiive » ComStearts O/C, ard Ca. Gud. thet T° ee > GL vo qo WH Of Fm) atorys [ies beterer eo , end GACn)) in Clusive > —5 The value of FOr) ites o® , ow wel (29 Cr) In ater ’ value, F Flr) iy egval to OC , fa ctor. , , ' ox ame (66m) are ot cule for eu meas The =) to utiin DC 8) No C1Q>0 med” > < Tupper Bond CAyoves)} Case = Om) % Given unction gin) we denied bY Gln) He set af Rewetion, OF (m)= £ Fm) > Ox Fm) SCHCm) for cul n>} oo Pies a PRED ind of 2 inction om Ehich ca Constor AOe — crite (On) = O(9(m)) iE 4C cn Pxitive Cnsiants 2 and C suck that othe IBM of mo the wuWOl fr) Aleeys fies Om & pele Lae > The Fem) valve must be faster to 7 CO) oy qual fo bd fy at) le ~eky Fadjesttein 4o {Gi ato) 18 t0.Q~) FCW) VC.9Cr) od tm) Filmy = COG) ~ _ Caco cower i Fen) S0.9G) ‘ en fs Eno c ss Ord Sys 5 Ga est menge Sot Bee ace llc o Dat nN Wurl~r using Coat Consist oF cacy 4— into Jeo PHrts ¢) ize owe aleost Sa 5 Aigentthe:- crete CAP) x < Ale) “te 0-t Gert quill) TQ do seat Jeu -| watile A I Gucuet Sort Fans in |inear GQ rmifaom. dis tatb.tion. Distcase C2) ) nema case @ oe oO Cr+) © Grtu) as ote ee =) AlGoatthens - Bucle}scot (5) fr jo to m-idlo boi Jeo Por fo to n-I do b cscd Examples. DERI Cond eins Sb Sg inloraen Prop], Poodle a 7D Coerge sort, Quict soap) ae > Tees of Hema; fo Lin@uor Serre), 2- > Llimeas Sencha et S Re s er Sera eebgenitjon Ord oftem Conner Dam Ae WE of cccachi si Pg 108 Simpl) teavesse +0 Ist Gyole Cind mfem The ch Clement of hd list cith the “Hen i ae | location 1s to he Pound. : nen 5 5p He moter urd fhe location of he Tem iS yeHomed, i orhereiso the abjorithn xCtwan MUL — @ Gesteusel) @ mersye case (6) GB) aowstcaso 20) On) on) ee —, Algorstthm limere search (Aw wae) shea: pwttaliz cet pos = -4 ar grtialree SE tt 3: Repeat ster 4 chile i <= VOavevPavevpevparaearrne ~ RPeal Step a rmdi Ne CKmet not fourcl ST Clemat fourd iS Seereh is on-of He fers DS it is Msel Por Finding he locectiow Db woos om the PoivciPle of dw ehnique > Brow sand Morithe Conde —) Complex : © Bes cose CA) Ohenfe case (@ @ worst case @) | eo) Clg) Cig») Algortthen :~ pircirs_Sermch (1 Ibs Nb pawl. ) wlize 3 cerbig=~1 Nd» Pos = L155,4,€ , 13.19, 204 find Clement =19 im the cide See 1s TT] 20] > Sir middlé € emer the oiddle =e Check bIs}s «[sTisP2 he eid Gnd fed Cla = era ogee e he found aight Sid Bree ils) Fle] | ule] _, Sh lie ae Pind J CPemA$ |ocdfon s- QO) oni Jet WY 1234 by clivide cind domques enethod/. => Divide ard Cor{ure wethod pa Oy) = 12 e235 x % WE 18S Bet =1°+X C GxI00 90046) =J4)) Jasualo$tz (42 x 12021200-43h= l234) 3 i . Jeguel Pacchict Cam hE Conaded as Bet x (23h = (eo) xCiehut2) = lo wY -f 1o2m2 + 1%xY +x2) Ss lee ieee idee ce, ee id ee ne cee a s\dwh + (e202 49) + xz .__@ = [00000 +1 29¥00 + 2901, iv DDxrPwem eM€ Gch A> yeGrsve Ay +oxe Hime - Consort] T+ SAVS : arch Sub Prokem Prokp Bes mae ep D> Less efficient fy stare Solution of subPooblem £5 Joes mot Stove Solutton oF Be oe we cuatin ‘Sub Pacblen 25 7p ol-—doun oulgor? > 70 -doun oulgortttn, Z5 cary Aersion Sofuen(2S oi be J, <> omi§ me cleciion SeZuOn(e Fs Jas Hine ConQomng us 1H OS he nS SF HA PREVINS Siypodiem, Generated Grek SD Dmamie Posaamoirg 1S slution 4 eke : Cam often HW Guile Complex cindl > Dde anf ConguBe YO ohdion packs Ore SPE OS ConPre@l4o Boapac WS Grtmic Parga 1s Gonesuy usa) a? 7 OE fo Pfinteation Problem . es oN cinch Congune Com Jo 0 ae DI t= retain Chain owt Plicedtom , ne For coms “Revol of Peo hl, : OPHoal bru) soosch }ree “oxeel: Meje Sot ee breed Seem), ; @ carting Charge Poodle vst rf J The Change Caling Parhler actloesses dhe gestion of fading tha: cnimimes “ANOIYES of corms jul add NP tog ger Coorat of ors, (cot £59 >0 Hen fast -Yaue fo pve. « Rite) «= OCs, I+! Es EQ oe t41) D> eae > The MnafSeck Problem in fe ach oth © exch Hen to che ha iS lees them ow Gal to 4 Gtr TS as fewher AG Psidle - 5 [RrciRticld Probleen basicauy oneoms og A bg of Given Carte of tY. SOE Conf to PK m Her TH Your laggage - The ies is Berth vi doles Und wf -Povnds. as valuable 4 loud cts Paw; Aut + ord eet \ir).; ws >c i ! Seo t > Ben ao 0 9010 ]0 0] o[o| \ 0 | fo] 10] (2 | 10 | 49 |to 2, Sinan i Si jo iolie |e fas ea . RES) K ts =NoluGreay = \e4h (0,0) a ers) > AK (ays) 10,0 : Eleis rene 0 is max) ) ry) A016) Bee \otk (os), > k(23) > 1KCy & HY ih (a2 Wl seeniaies , Orth), seedy tue) aC) (125 0510) (1.24 Jo=-22, 10) HG) wise - ie 41x (2,0), K ast (2%522) DEL for Ket to mdo for $< | ton do for Jet to de Det We hin ED BCH), DUI + DEK sy) sehen D D. Time complexity = Ov?) ae PLE s- ea Ori,33=0%mCOLHSI, DE IAD EH, GI) multi lication, Ustad Ene WM Sequence Gl mee Subs eduence, e > Fird He oimionion Cast of multi Plycrd owt Gach subse Bed) shes? Costs together amd wead in the) Cee omit Ping the joo esulh Matas, sorte: M093 = mD,25, A3 Lie + 2A hx2 | Gu) mim ~ MC2nd 2 Mm [233.4 Bue mtysd-as = mba) mt) SOhdawsyy = 6h 43042423 a5 ain Ay. &CUSD 26434, = 190 —>(P,-Ar As) (44.45) \ (Ga) A3) (As,As)) > [E0eA,a2) Aa) CAs 45) © Lorrpest_ Cormon Subsequence (Les) owe Giver thO uence Problem 7S to Find a Common =) fha ger of sefrenes Sab Phot =) GeamPle 3- co of comimal length. os =m fie meas) i GwetSh ALN tae aS long est Common = Sub’ Seu @nces nes ww |¥y a ft a 43/84 vielen eel} Mfortthn. Im crm OP tmecl, § @it wowks in r @ maintain devo Chew it visible or not © feasible Solution. : 1s Gacedy aforithn. Greed} chistes a set of xesoraee ape xe pho WESABE atom Gen Ghage nes ww |¥y a ft a 43/84 vielen eel} Mfortthn. Im crm OP tmecl, § @it wowks in r @ maintain devo Chew it visible or not © feasible Solution. : 1s Gacedy aforithn. Greed} chistes a set of xesoraee ape xe pho WESABE atom Gen Ghage is Choose, ect Cow fhO choice me He Bludion foSub- (D less SMF Cet @ yr Dfraentc repack . = ceems best at “he ee ogame solve the Chelle ecle , sin, ff af tex 40 @ more efficient ethacl Hee is no gud @® tm greet guorrcmtee of aeHing oPtiow! Guerrentae) Geneacte 4m Solvttom - | opfimel — Solution. | @ Dsrewric ortted 1S @ Geealy mrethed cre Jenerany fergtery. © A Bred method follow S the eeu pres SMS peristic of Meming Oa Traci PyoGaconing jhe lecaxy oPeal Choe at Cure) | is cm “ondlevithon d€c)mi quo. kage. ah ig Vows basel on a eared (A ee jous | Col culet eck — specteg | Mamcvease cneenores) ComP le xitad, @ ome cess eflicied @ Sewore = OL Ural gat. and Jongest: inCaeesing NpSene Perini Cost SReming free Teh Cast = 116 +10-Ns = S& ee sf inning ee € 4,0, F6.089 Ve A027, AQ=5 , 9879, DEANS DE=6 , Feew, FEE, EO =9 Bees, -ER-+ > CBS Hehe sPmning free. Hoo Houch/Ml’s cttortthon is aliferay pee Pr im ibiigtacainiateninl Df atoming trees om Suet of Goth © Aol Lis au qe ewices Covered with orinlowen Posse nucyrr of edges. > A Harming tree does rop have cycles cn Tt Commop bE * dig comociel ) Kc as cet BSseeeeveve#ee Generates the wminienia, @ Sferming tree — Seraitr~) oom S0crmn§ — Fpe2 SiR the poor Vortex. | jhe teasp Weighted Ye : \ ete aues fo Pind the Shooter “Path beteeen Onj ro wwegices SF a ghePh, ‘ (et a se of nodes flat have The algatthn costs by nidirg parties lis tence From 44 Covae- of tio Be Cam Gx Gute ue to firl Cm oPiioak SYXence of J phat ou «tOfel Poot fg cwtcimized, =) Sel me LSEE PrwmCits = (0, , Po, ParPiyi Pe) = (20,15 1 ley 4) 5.3) Deodline CAs des day day ds de) = C3141 53, 3) ‘3 2 See) Po Rs Pu pe” Be eee > IS) jo PR Se | feodiine? 3 | \ 3 es) ) § rc) is 10 a fap BG) omsideZ UorPasecy Chererts =o, o= (120, 40) amd a (6%) Foe) Fora HE cresed one Prsfthe pect -1K a J PH GES stack yo pemeorper fo 9 Vahen 1 ceed ond octurrs > mest Aes visited cmd adé onto Fhe Seek. > explore Cri) Mnvisited etcljarcont roche Coon A & md D ere ctdcted to A but oe : ee ae ected For Noviditecl oade ont, D> VED ard mart tr cis visited etoch Pt Onde phe sHerct, nee) 62 be Bard a nodes» ahich cm aclfaced to D cmd Bot ae unvsited. > wl Shate cifuin, Choose Prem cites cat orclen => yo cheese g, eer Tt cs VISIR eam pu ero THE Spctt . > were B dees mot hve emi Losi¢el, edit Cent mode. Pea ee PoP B- Prom ne gee, > we cheeli He stack toP foo gefaw 40 fhe Preving nade and «check Tf. T+ hus a Vevistyed modes . > pese » 06 Mad D to be on ce -el4es crze ovderd pates- : ‘cam be Potleued Fro one veutere to F Neo kX, = ‘ cent Sa Ve uae | fq Sei Es So a Eel ' Re avs © asite wef rel On Foroftel SPH. Topological Sout. ,@y => gp isatiness aahezid of its Geotices Such hed Pr verd divested ego wv fr VAI Utov, “A comes fefore vector Ut ofdering . Becrcl chaid be DAG Cotmoted Adel: rath) ) Gexy DAG oil hve atlest ond 4opolagical ool King. Pi y' 2 aye I) oe ey D es G J tos -©) ¢ >. nee pear Le cae. not Fin! Out there be SS IcTaey C8 bm not torres aged ! Sort Find Out ' ' ' ‘ 5 . ec . » - ~ Cd Cd ~ - - ~ ~ — ag >A touth Is um abStuoce ol thud Old +o Tnelerert the OS, Prop metthredies. CoNsetion oF vevelso f aeeiet | ‘A Gtha lane SF , pet ee ' {bea i GHEAHEB) 3459245815) : o-!3 ze ie , Myre} Here Wy wocllens ard WV Tbs, Ant corer Gan be a ssigreok a perfec An) jb, rncuraaing Sore cost shar well Med de Percling om et tab cecreert « 2+ 8 wotsnel Po. rer fear ia dale gasiiniry exact) one eenkee do Each dob andl Cverctl On& dob im Sich acu trot he toed cost of 11@ ; AS meme 2A. Heal tom Rossi ae a femol cu Poor sib (@ Soidton ia rohler, eo ts rd Te dest olution Hat Vive gecision Prosler ved to > optieisation pysplOn YS! Gan b@ appli ea Diserss Cight Deen's Problem vsing pack-reecking. > THe CaA Been Problem of Plackg Cat class queens om cin OME chesporeh So jpat nro joo green onberctt Sh fea. Ths 12 Solviion vegubes that me ve Aeon sheme Ne sand row, Ontion 198 oleGemel. Ths 1 Soldion vequrres 0d» Coltmn, or cticgorat, Payee eum Ces pee Is crm Geopl@ of he more J Cnlrert = eens Probler oF Clack he Mone Solutions ist for *t.. EEe o” aa exceprer OF 4) 2emd 3. we => The Soladton fogsi bilities ewe lid Covered oni) pie eee shat no feo queens shame jhe sume PTR: aie ae POR OPP RROD

You might also like