0% found this document useful (0 votes)
45 views12 pages

Important Topics

Data structures

Uploaded by

englishgreen2
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)
45 views12 pages

Important Topics

Data structures

Uploaded by

englishgreen2
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/ 12
rece ent- 2 B se (4) uber bovurn - alee Assignments < . i Unked Kise - 0) A corr dekinaktonn +o orale a chrewlour * a pats: patent remit oO srode poludising sta cirular vode in tre drowlar Unkel list = Romeriing we node pointed by cirwlar, ond ring UUKAGe fy neu node dors node t public : ink daa 5 node * pot yode (int vat) { dukon = val,” new = nyu J Is oss cit node” wreor ; public = aot ourser= NULL, } void rumave Ly { i Corner == NULL |] curser newt = Nv ok <<" Can! + wemive node 5 Jotun 5 } node * stomp UUme Rene ; Oued or > neat = fe delok empsy A ee 5: a 0 ane it in { w 4} 3 Beaty ok 2 eh Boore Wey 1 o 1 L112 (el kT » 4 # , 4 Vy Rompe One Lette, Oo 4 Ww v Vv t - nde, an dedrenic mathemobi cal ealukating’ device . (CA* (@-0) 4d) $ Fte) me Bret We con Me atack fore, ox He obgve Capresty: Br is in i oe one with Pewdrcthoris) wb postfer netah’en ce i). Bubolize Ompry stack 3) Tawalize emply oulpul sheing 3: Sean ini exprearion Ut to right) 4) For cach aymbel + -y Ks SpocanudL (variable Gr constant) , ald 4 to tee bukput gees - iy THe Sperator ¢ while (grack b= NV) and 4 x vic ator ie nok Omply and pre cadence he uyrrenk Sperattr is less Hea or equal to Su p mt oporator at tu top Ke stack, ( a Boral (jdeey atuk ond add tt da output string. pul the current operator BMD Hy stack -y "Oe", push vb Owly 460 Bear - Hay ies 7, POP Par odor frome He Shick ond add Hom pews RA MAL string WML C7 ty oncoumteredl » pep ond dis cared ty» % Rep any Semarang Sperats from he AIC and add Hote ty the ah airing - . yo tae (8-9) +0) $¢+e) foot as Abc~*O4 e+ Ete 9: Tiyerence between man— heap arch min- heap: Build 4 mln heap 4 wring followin} dota % >, 38, 50,92, 55, 40, Ny Stow hoop atte each inporHon . Man - Heap and Min~ heap’ 2 Man = Heap + © Even Potent vede hay geaker value thon ey at tpt: webu YN ohildven: Ca 6 TRL momimuum valuc leak Ux coot . Key of & node is less than or cya te k pear Po orlty Gp where Ingher prio deme wi te with baker Value. , 2 Min = Hegp . Every parent node had Value Lerh Fran oy CHad He wl dis “Uw Ldnen othe minimum value ig ak the Hoot - * Key | © node is greater or Spa te the Key 9 its child. * Wed in te priority ghewe where Arighar preity given to Womans with Uwlr values: 2>4 65, 3p a ae Vb i yin to b Heap! Heap iso rpecul Tree~ gored daly Structure ja which Hu Hee is a Crwplete dinowry bree (heap wh Woda dy leg N heat) : ; Mae fo HOmave the right or loud Prigritg demant~ Hin Heap * ( titer > Parent) Tart 60: Se aa: ae oe a ° Os * Age pe Sweert 55° Tuer 4o: Addie Twert I. RRA AR éw6N 68O28 GC wEw Tovet 2: , oh > ® oe a) cob, bak, dog » log, fou, Ley» zip, yogurt, wh, top, ankyaumn , xor- aye th dick Gr | Duert feo ores] eas » GY, R® _ dSw & Exar] ay gw, fe S RL cane Right retae* cat Lt retwe = ont do = aoe Reare = omar : ye 7 ¢ eg ke meet & oO or. dos °@® dy me x Se a 0 fA 3 a) Give ouxput i) Cony dr Ye linked ist - go ha 89:1 92 27> MULL cick unt Cole * 9) Gat Dat" N\ Layee + sur) syste a sek | post (pt net? new 5 ( a cout <¢ + date t\ Y aot date tl Q+1 = 3 \6 8 MT @)- Gongdor Ha linked Ust § Ie 22324359 45 NULL a wokun | wid pr (me 8) sae Je { 4 Cs 22 NU) ; (aye. wekum 3 uk « gadakas we 4 (54 newk y= KUL) 5) goturn 5° ford (52 nek nent) eto 5 Now $7 new) Rew = NULL u “ . ‘ gout S59 dake; j Bo Jalve wehurneal dake 1 , i): avite uncon or tu flow ng + y Remade on Clement x from clgubly: dinked Uist g integers. wid omeve Cink x) $ { nol? ™ 0 = head ; while Cpl mu) { i (p doko == or) £ 4 nent ~ PP newt 5: y Cpr net fe nuit) £ pe net > pres wy, J dse f death = 09 nenk 5 iy (p> ned Je aut) (pa nent 3 prey = NULL; yy delue p 5 cour & * Clemantindleted ”; 7 *" Fe pr pr nents i} Cound == of out << & Clement not to ae xeturn ¢ 3 : ii. ay . A) Consider we follsiaing secursive fonction Double cale Cint — it 1) f JE (nee oy Meturn if els Fehon 1* cals Col, my 3} Owput Y eal ae wa t (s.4) cole (5,4) cae (%, n=" Ws x5 = 695 R5 x5 = 125 SxX5 +95 Oudp we 625 aT) ep kS-5 cate (5,0) (n= 6) goku | Y) Hew Hecwasive cal will be pew + ute cale iene ies ao fae 5: iid): We Herakit sypteen vergion. Jk colt [wr a, wt nyt IW ow while (n>) £ orenudt = SeéowAl * ne 5 mw 5, i Hokum ult 5 7 Y Onaiclor ake foviowiny recursive fine Of Arte a versal + Haverge ( mode * p) t a)” C6 }'= 0) { Ton Uke Cpa eye); Hrowerse Cp 5 Sui Di, visit cng aw MPIRE npn posursive / [Hera version junction drs vode { public! ink chide, vole * Joe i role * sigh 5 de Cint vat) £ dake = yet Aye = wight = yu; vik ieeerhne Post order Crate *reot) { (root == Nott) t qedurn q y gtacklnolé> Sask |, stack 9; stack (. push Lropt) ; Ninile C} stock 1. emphy 0) { wode * current = stack t. fof 9 j Back \, pop D5 Brack 2. eurh (curnet) 5 WW): Write Horak ot Syste version . dink cole [iw or, ink ») if Set era | 5 while (nr >0) £ Bent = Seow “a ; wo 5 werVn KBE 5} D+ Onailor ahs folowing recurs’ ve fof ree Ha vee Woverse (nade * p) t a PY 0) { Around ( p? yr); Howerse (p+ gui Da visié cnt aw NUR nan sesursive / [Heroghi we Vera i, jonchion dis node f public | ine dda vole * pope j role * Sight ; we Cink val) { dota = vol Jy wight wot; | = ieee Post order (nase * rent) { if (root == NULL) t qoturn a gtackenald> Stack |, stack 9 5 stack 1. push Loot) ; While C) stock 1 empty 0) { woe * current = stack 1. PD 5 Back 1, gop 0; Brack 2» ewh (cunedt) 5 . 3 tele |= NULL) f 4" ett push (curvenk> tet) ,°j L Comment? svght [= MULL) f Beck. Puch Cumin > syd); 9 while CL alsck 2 ompty off ole * ourent = stack 2+ tap 00 Stack 2. pep) s cOUk << Curment > data ee ad 5 a WAP 4p ford in- orcher proders oe So noke in Bg. dass node { public : dint loka wile * la vole * tight : noe Cit vod) t dota= vod 5 left = sighk= NOLL rotle * JindMan Cnode * ourent) € why le C curnont > mohk” S= NULL) f Went = ourrent— might ry eturh arent ; node * ord — Trorder Predeceadsr (ngle * vent sit x) ¢ wpte * gwrrent = vont § node * prev = NULL, whith (Gurene |~ nue) £ a Current 9 data~= Key) { Lowrent + lope f= uit) Ketan AidMax (Orree-s ly) y be f sekun Pres} che Y Courent> datect Key) £ Pree = outrent, currant = purrent > sights} dhe f cumnonk = qurrent 3 lot 5 yy goku, pres y 5. b> Cahbidey ingle enting ‘Dowoliy Broled Weuein three OY’ array, loud, ; sig i Trert front (2) ier 20 Cr) - Who ayn Cenirts . 4p ma ke space the hed 4 (or the meas singly inked Wistt 0 (1) ~ Drop Ok the beta, Doubly linked Wet 2 9 (1) Twser Qe beginning | i): Sort Back (e) Meray 0 (1) - ive eset at te oad. Si nly *OCn)— trey UST to He end 4D tert Doubly * 0 (1) ~Tdlielty insert at end - 4). dolore Front fray OC n)~ Wren, AlipRoy elena afer Pemerng fromk ° 95" oft) amgtoh from beguianing Doubly « 001) ~ Delete rom beginna Wv)- DeleleRooy 9 d Array 6 (1) "Pedy remeiet poe sy end - Sirglyt O(n) Treworse the Wet to ve cand. Doubly + 9 (0 ~Direokty delete Jom the end anich He obeys On i . 1 un? et Pe SAP mt a om Aouloly Unk list aap eHicvens- , 6b) Gnyider te 4 Ber (Gua Pper. Tmo der Sy cress og: Lepr mast hill 8] reat gublree . (08) \9 in ye + 6 38 o> ote NADVAVZQOW® G ® Replace [4-by tI meh an TA): Twrerk given Keys in vt trees - Shaws each atep; rot wi be We heghe? oy oo, 8, A, E, \muert 1] wet © | Tweet J] ‘@® . @ 5 i F ° 5 ‘oy + on Ua A R ° > FO @ “3 a po "ao, ‘ t u we & ' Right dotale 4 @ By ty void Hereroa Seve (stnckL input) { ques ink? g while Cf inpd + exptyo) 4: puok ( inpurs tp 0), Enpuk pop sd wlole Ul qe anpty od t input» puok C4: perv); ype fy

You might also like