You are on page 1of 45
PUT Sebuber KCS-30) (2022-23) se ct A. Gl, what do you uncleestand by me space. Ang \r {2 trecleoft 7 Th Computer Sderce , a SPote~time theolberp is @ wor of soling a problem ov caliuda~ HO in less tre a using rode stoAage space , oo by Solang Q Problesm Ta vert Ute space by abe a long time, . depine Abstiact data Type » PAG pestact ota Hype is a mathematical wrod for lata types An abstroct olote type ic clepined ty its bebautout yrom the pant of Mew ef a USER og the Aoka , specifically im tehkmre of Possible voluce , Possible operators on clata o Hos type, and the Selaiour of these operations . So, Abstract data +ype ic a date type, Where ory belanour 1 Ayined but rot implore gation , GB. Riscuns the Signs Can ce of Prerty went Ax, The Prony ques also kroun ag the drryfe) vg used to Coep toaule q a prowess , tte one ger wlth a as bound on tte tokat path lengts Is cmablect is given bugle Prarty: pb peaty quttie is 8 NAPE of quent 4 don get ehemagts beset On tele Pol eRe AY: Bferentate between undujlow and ever How in Unted Ltt? into Jig Olen mew date is te be netted stature bot Hrets iS mo tlhe mare avalasle space be free Serage st Ob . CD SSEPPSGDSSESSS Revue the fosmute to calerlate the heigha of a Snaey ee < ( oo au Love N Che mod - tte minimun Leight ef 4 binaay tree wih be Loa rey | for ow quid prey bAee » the maximum height eceke be [ef |. totat axa in-place serting ah goritls 0 oo eelhcsrhrlhL Lr _ An in- Plo oad obgoAttm Uses Constapnk space fer Producing the culpt (modifier the qiren ney onlay), Tr sorts He Ust omy by weeding the orchoy og te elomorty uitlin the Usts Seared les « t) Bubble soat vy Selechon soat QE Discerss the adgacenty and AK. Gwe an exe Pu papattedt simple Labelled graph, ee Oe ee ices) Cui, vy) accor Ung ea conakition wollen Yt Po adjacent of nel: ete é ag. depre Cmplte binary fren and extended binany tree, Msc CON on example ( An Complete binary tree —~ A complete binary aren is & ert tyven in ww abl tbe Levelt Ae Compled pled expe pt fess bby tHe lowest cma, pode te Glad form the Lept * Qa Dastingeis between trect and a gop: Ark. A yap is a set gy vertices frodes and next ; P= iheds 5 3 Ol muds.) eats : Pass ( “eter Wee Safewrnedién ol nhl nets’). Sean$ C79" ap > nf); Seen =. ext =p; bo pest = NUL, 3 or oon Dicuss the j Section B 1) Discuss the implementalion of singly Linked Lick Wetec tunchans to imblerm Dlsusin Operations on singly Linked List. 4 (UV to count dhe. number nodes iD) to inseré node as ho ete ~~ cpns- Linked! Dist 8 a cadblochoon af nocles ushent each node centains at feast two fieldls- @ xNnFo > “his fielel contains dhe. actual wale to be stased. ® Nexto This Us dhe address duvte! that ceontaing dhe. addhess of dhe next node . Ne Es nool2 stezuct nocle {int info; Struck noola «next, stuck nocle xstart = NULL; TA case af fast node, acldhess field corans NvuzL. Wi ‘'c! fumchen to count dhe number cof nooles int count_ nodes ( staucd nocle «temb) ie ink count =O; ah (temb == Nv4) utin count, chile (temp! = NUL) Rount =count +! ¥ —jemb 9 next notiam count; ert node as fast node (i) Tons Cork -T Ghent isis iy Stent | Posriext =NOU; af (stant == nul) stant =P item f ua” Pino item, Pr case-E when Dist a not embly Stare (1a) 1 Co pe ae Be} 13s 8] ia 260 — else temp = Stank; wohl (remmponert NOH) Sob +emp = temp 2next +emb— next = p. po next = NOLL; p— info = item, stark; ll glebab declaration of Stevt ctauct noole * void inserttost ( int item) £ node «tom, xP; oclo) malloct sizeoF( noo), = NUU; [ = item; else e ite ( temb— nent |=nult) = temponext; > tempronext =P; Gilt What ug hashing? Boor explain probing ag 97 Te udlea ap Linear ho ag simbla, We jabe a fixed Size enol cmd eo time, WES face a collision. we (pe rse qohlo in eychic manner Jim to Jad newt empty Alot. alae | Reoobing Quachahi obing opens Tay iy sot Pe 8 “Siignal hash relat of an anbivary 4 qui empty Slot JB found la Success we palynoriot oe an GB Wseite am olgaouthm : using ot geet Fes | auch eon ° 10, 25, 16, S, 35 48,8, sh Guick sot Meanitins rr us a olvole and canquor ab geaceithrn . step-12 fick an olemomt prem am wee, —— cell Gt as pivot element. Divide. an unsented assay ve +000 Bub-annags © tamnent stepa> rp dhe wala, Leet dham pivot —ome melon Bist tb a oe nemainin olemont& Width Ce greater ham pivot efemont anne. in Second ssub- aMag- Roeudo cae > Babinen agen ALGORETHM Punter CACTI, BEGIN: pivot = A pte) d= tohide usj Do while CALcle= vot Ayeub) Do d=it!l while ALJI]> Pivot bo J afl IF dej THEN +emp =AL] ga colhee Acled ALLY =ALIT _ ALST = tem step: _step-? Lb, ub) ALGORITHM QuickSort (ATT, £b, Ub) foc = Pantheon Cn, tb ub) Quichsert( A, tb, foe) Quicksert (A, foct! , ub) END; Serr dhe given sequence using Qu Guck sere cero L6] i] | 35 | pie]8 | ie Poot = Apley = Aled =! 4 rayiae >] be c a= while Avot >= ALJ 44 deub edt Here ae be otl=! (oe false al white Pruote ALZJ gS! ioc 8 Felt JHE sSwosb Aly, ats] Peters) 3 | =|) ] att Sarna dae Soul g-3 Swab ALD, pt) y rile] Stel | ss] | New itt + Sy nee he 8, jer nay =wab Ale7 coh AP] EES ‘=~ 237 4 os eo wf 8 [s | & fasfus = J a s |B DIEGESEOES Naus Pivot comes at its cored sition ot Diviele dra anmay into 2 sub amays. = 3. 4 5 6 5 [8 |[e]| 16 [ 8s [48s] ue aS oD Subanayt ubanay) Nous. crrpeat dha Same proceclurr per bodh -Bubomnay. At Bast your amay coil be Sorted. s| 3 | 1o/ iG 35/48 | 25 | boss 0 SEEEE'~S' SS; a Sectien-8 (4) Yes, we cam camstyuct a unique teed ushen 40 teaversals ase given but outa} tus al, ene must be thasecke tezavertal TNatsEers Given haven : Hk DB ILE@FS MTG Pezawecder: A 8B De ieee ee 8G) Hee ae S10 n nocle zoo FOm TG 722 SEs osc Farm © o3maG) hozaqrmM LOsHh ro3 Ti) fox DH PrOsEIL dp Ios Ios AK Le R03 Ak forth oo ae stools KHDLTEBFMIGCA Ane C3) Given P(-24 2:22) and ACLN'8, 55,105) O Fee P No: af geass R= o-cnHt=5 hx No- of columns © = p2-2+l = 2! Gas Fo & No- of Planes pr= B-i+! =8 D2 = 5-6 get=ll 5- Cleytlalé be, P= RXC= SX 21205 fra, No. eR aus No: ef coburos Da = aw No: of cloments In No af eleanents ‘n= DIx02xD3 = BxUxle = 1408 Ars (iD Fee & Clete “5, 10:5) Findadhessof &[3:3:3] Base. addiess (BA) =4e0 oloment size (QUEH effochoe incor E1= b-et=3! =2 E2= ju 294 =8 L. Ege k BF 3-Cl9=!3 aclohess of a foe se 8) = Bat [i-e x poxng-+ (f-ea)x0se ck -S)Re = Yoo + [ 2x1xié 4 Qxle + 13JX4 SS Ppoe 1b eee 129-413 J*4 = Yyoo+ (4a3x4) = Hoo +!97% _ Fe Bek Sechon —C @ay “Doeseibe knuykal ith & Pind the ain | Spanning aes Oks ek) allgosithn omd ° én the sete G8t of the mst: hy The Krudked thosithm 1S ued te demexste tn Spring hee mom, Bete taka evry fe a aiven Pett. srminy “bie? A Mrinmum Spanning toree Subset of 4 G"bh with 4yo Same nombey othe Fbh ond alge Sua) +o the Mumbest of vertices 4 Hay fy S minima) Ggp fr sthe Sem of ali abe aight In q Spamming cho, Kea kal 's Sart all the cabtes in increasing cage weights ancl Keops aclelin if the Chasen ealee doe not Cycles Mae , 4 pick A the abe wrth 9 = Hg marctane, S9y that the Lprith, Q ertt chien, Itenoling nal “the dlebed optim all el “hy # ie auel a Grey Algestin, Creatin Minimum & smmine Bree Cae Pe lous s Minimomn m Cosh ats Kruskal all Iw kal ith an, HS Inyohyoct Tr Kouba l y XMM morn Spring “Tee, Ayton b > Slept: Sort alt edges iy inereating Ordes of hele ebye corights : D Step 2: “Fick the Smallest Ce. > Step a: Check ik sthe neo edge Creates 9 cgele ov loop in 9 Spawning chee , > Step 4, if eee a cyele » then inclade. “thet edge in MST. otheswide, dt3card ap D> Steps: Repent foem Step 9. until} th includes, Ww) —\ edges in MAT Using the Step mentioned above »_you will (ee QB minimom Sars ctiee Stuctusie , Bo, Now have look at an example -to Undesistand this Process, “Tre h Gv, e) given above Grkin 4 Newices and 19 ehpes + and You ill creak @ minimum Sparring “tee T (vi) EF’) for Gly,é) Sveh That the nombex 4 Veutices fn “TY wild be 4 P = b . ° Aor TMs Sep, tou will inclode edges im the MAT Such that =the included a erie | not q cycle In “hee Sbuctwie » The Frat ede Heb yeu wil! “Fick ia e ‘CE ) } os i+ has 9 Ming tecight that 18 inimom ge 6) © ® @ @ > Add 2.0 1 as tt Las a minimum edye wouight hat is 2 (3) @ @ @ 60 > Now add fa, ay hag aq Mtmimum edge wetght thet 1S 2 D © 7 : @) Yy ca oe : \ > Now add dee AR, iF Ras thy weig it that i + " emg aS ke oe | Ue CU AA hei ah eo iP Y) fi \ a4 Po odd EF clay, ox 1 as A melt 5 \ * Ney4 a is LEG bis descareed , a8 —thig des " oi vil 8 cyde thet IS net M97 Property. \ I next eye POMDE | but! gt ty clescavcled , 4 thts |) ; will meke q wiles > we Wd @p i werk is 8 Mes re ole ats TTWhe = Minimon Cost a MST 1S Y48+ 9+94St0 yo) ET LB Derenb e Dijikatre atpethe and Appl 4 Dilikate ttn to Hind the H Shertest doth og Yooh : i t ty 3 RE be aha abgerth is a Shorter} path abpaith Hea, Single - Souies means thot Orly onle Sowice is gen, Bed ue have +o ffrd he Blerlest ath from ~he —Swiee, According to Criven uth Gr (me) > PAat , a We “to Canuides: any yesiter ad q Rouse PR, ehh ye Gratdes) vertex) 28 9 Qousce perce Bd Dine Hee D a Delete each | node Dre. by ow, ‘pb @elete 15> test node of ha Heap be 30 |2 moved Herre | >) ies, Last no Z o1 moved hese, 0, two) Sua » on. a : BD ( is re Fe (tool a0] tw [oe] e/ ah vo | b>| W> Ddere (ee) 7 a Last mde rived dove Be Jeo] ol } a pi bau ofl i lee OF & aa (0 ee oe a rite (6) JD i lees) ae © [Ele nleTeTe ie : — aed 8 ™) Delete (EN) a : <3) 2, (ite) ee © es © rae Yi le aay ne, ho et » oP. west oe | @® » eS wy te) » ‘ ie.) Meat (ie [Be] Be alee] 3 OS i) B Hay jg Bhasey Sapiah it foent- ita Lineas| Seach 2 BY bina Searchats find Hem go “hr Saed atau Bo, 68, 29 N22) 80, 83/40, WY Fo, ce 77, Discogs ~ test, bay d ey SexIh os Rone Bitlonthyih Wletiicen Lineal en Binary hineas4 Sessich lek Sexe, ® Breas) Seach is ale known ee Sener Soh ‘ 7 . [ a Se29(0k hi known 7 Imteov9 9 Soadich >) Bh Liners Seasich, ace ray y 3 Be Unomied a eS 30051 ch oy orreay 4) OH is less Gomes 2) It ape “ A am g0 D Gis sho recess D Si fet ae POON Orewion amran'an see > eee ae Le vay Thre Opn ity ‘i Oln) CO the Grr glleuit by Olt.) Pane, | [Leas lama sal uo aro aie ist ef ‘7 Sept Frat dnd the mid elomern te jum ANA amg ' mid = lowerrcbound Ubberboomt. ray Sep Bard ugh Bide mid Value jy redlwee ; zie and at, oy Search, be Ra Led se, is Stet value Prd velusif -dnid bs mid value = — = Ae GED 33] 40 iy 2 nee: Skp u_ Gripes ‘Key with als) ig =30 Key )> @fs0') >, Vc tsi. Skip aaah lef index of 3 and Kien vad Sub , PRE Woe Berk ~ ky. 4 iG mid = 4457 a 4 g me Sen Nod Gmpane as) 14 44 Git iy eis8 a cS yh. ey Seaschtns i iBaceeso9, | dy ts at iW ah Time Grnploat by A ar \ Ce) Debne B- fee + hana Q 8-"hee der | ‘ej he lst Wa yence af “hpet order § le) 92,30, 40, 50, Co, qo, Bo, 70 [leo , Bapy 2S, 28) \\) 10 | PRR B- shee is a SAL balonctry tree doy Wide! “het sites’ Sota) deh gel abou Sexvichg | Seq Yenhtad Aecess, \nSeetan d Deletions jp Toaaaithan ic Wa ge ee ae emextizos 4, Bhavy Sessteh, chee , Allowing ie nud 24 Be More then) hoe Nd And more aE eH “Tk tadmum chia of bee rinimom chs yg * re Q MAX! yn, Req 4 Bee aa A. ca te! he 4 M. tak chi and Recovaling 7 Shen Buaiee | ee SMoOKl m byn. Auddven. aye Fe ™Mnirnoyn, chide. ane HH Mardrmuyn IKey mninwrh key = | Example 1 Jo, 20, 30, yo, SP, G9, We, 8°, Re 100, Bao, 950, 98 i) aS oo SL Step) MOKime rn Key LielsTaetie ] x o0 Now nettles Grelilter, occur the Splid thid lithe. An md horthen , New 80 move to Upben— lene!) rae da | oan h, Grdiion cou 4 INA .| yelliec Wirate Ho et | 20|6e [les ols oe Nowd Sinber Next noe gy, Ba) 3), Lest Ire k— A |e0 ages Pele] TERS) Trelis etiosy 2) Nevo SJntert Goo, ats Gridiron reid Split ta nae “neve VPber lev-ey | Lb acquis mid Nib, Value Nous Snart as AP. 250" I5 easily Pree ienl Bo) sol. D pe Me Boert 26 hd tx Smalley than \Bo anal Ik Gy prerled eoally wa [qe Te Om ee ee hood Steyr 1 phen hniertel 4 Belo. Ww lo 4.25 4d) pO RR) Ton [elem Now Smert 99 by iy wi! gore overlay Corio . Slit Wo aray reve nial hele tn Upber loved . qmke 24 td mid value move cto Upper bevel i aslee[ ae ] (ei [aloe es) [#le2) [Tela] 250) Bt mY is Yeq Hye of b- Bee o Crleg 5 Qia(v) Ex plain Hutter Alpeivon. Coss Hutt tree Boe (RRA GR RiP win, a ephrel vede | Hutp anon Cooking WP: ao techni gee ¢ oy ay, OG 4, Feduce Ly Age aint Ase oy Huron re Ux voriable Lovet Coclp abe $2 tniode A Chanter . The codiy i Pegormel — on tre bain 4 tobenated py bart, A ocean 4 tre Aourck Character ag ad ay ar rerpltmented me cae Barger: Mp eet 8 mode for tach Chorades Pad thovactoy Orch Th weight fm rnenly- quan Cpe Aepeot sy org 3 eG 45k we. 4 nodes in Pre queue vv Steal fron Remove hwo roan tok have bower weit Supt: (re a ne ntearel hi Mais ea This hue bey and Wei I A Sn mede's weigh » eps: Ddot neweh Cratth “ede to he yx: OP eg eee Prmye tn ascunetiy inde 4 A R r A I pel gy fee eh ie] PAB () ode an hone. QL i cea G = Bie Rs ao i) ) Threaded oo Tree) j J Per etme, lied, ohare pe mordin. A Brmany Tren a b ray a NULL poinlen ny fre orpre aterm te Mrorol Anecemor, iE Lye, =% eine ee pa ON. Ono need i Sagal ‘ x “3 } i OV Reo x EPL { 1 er ® Oprm at TA a va: rae, Siinpis: Dab. tended Br or ROO ena ©) Time Cr penl ty — Te We aebeoL > Avcended Dern ae tree I © Bacher parse ee Ore wir Aouble - ~tveacled oe bre, | Disvowontepey » « © Complicalod rserton dnd blolenen WA 0 trreadod Yr treo Chen Ctra mere Urepe fo Ste enbea bits fo Dustonah Pawern 0 Pred or 9. bem oo ee b) Help” Potonced tree | A AVL tree’) \olncd ar a | Atight — balonendl , Meet WE With! Weaurl rode 1 Brocidtol ie” halonce tor Wh. v Calcwlatid y Aabtrochep we Fey Ww right? gable Arm tut 9 ds og subtree ' re fae bend be Blea Tneee VT Ue — Omerwist tae Vb AUN Seo to ieee Voesomce , MPrdoonce foorr Ce) = edgar lyre) — reipnt (atte) VL Tree Cbs re Atle tre i Aeare~ ag ee nor it fo be skewed When tre p br ms sf fae Ateweal then +e ie me Bry tAy, 4 Ne a ee treveaes frm | Dligm) fo O(n) ra fre badorncing pre modin Atl fo Altanm dre fone Cmpptenity 2 Olt). whee. mee, 9), 1B MEP) 28, he) 40 sd Re cwcion Hp A tevunlype a ter a ad ee a Execution fro Stack in wed fo Shere te focal Varley, hon Ae dnthen to tale Up Syl Code ae a ey. ee) (ae ke “- ie Tower Neg , wey env) hy, 1 if Nel tern a) wre Beg > END b) Reber } 2. Gil Tower (N-b, B84, END» AULA) \ 4 >, Wrk Beg +END Cou Tower (N-1, Ave, BEG, enD) S. Relun = ©) bite 6 fometon mpl mere Oro dleluton Pr Corer none Insert : Yord Queue ( ut Unmet) f ; UE ( front = =reesl) 1) font ==0 tree = See) prot (* @uee % fur); ee if (fron = = -1) frmt 20 ; rons feat) de size ; Queur (rem J = lomont pom €* Irvedea® A", element) ; j j Pe Belk pot wt Ae Ouow () $ th Comes ; VA (front oD, ‘ i } ‘ PME (Quon! onpy')s Weber | aa a | Pee): UL (front = =vea) Wi font = 1) eee 1 ),, i ( des free = fro +1 J Size ipo ("Come Detyas "). Wien (tlre)

You might also like