You are on page 1of 24
Date shuckure Assiinment > | Name :— Chweta Anil Sharma Rolline t= 202059- Write an ent do check singly {tated list - GO °F ee to with Ilowiny example. Bree Se egies S _pottodye € | LEAS Aaeral | Ugouithn Jos ctagly Wabed {tet polindweme 2 Ll» Mot V od é £ aa | |=) Get the shi ox number from the usen. | ee a I> tare oo temporary Vonioble that hols the numb ers. : J D> Revove the Aiveo number. I> Compone the J ontainal numb \ are sere, then Sor Gi as aS expel with the revese number, STF the Jose fe Sraicel number ore same , 4hen scone ane 15 o polindvome. #)Else the aiven shi a or number is not the Paindrome. B End oR ) Stank Y Determine the ool hpoint of a) lenked | @ Zor0sg Reverse the second half of thé Ninted list - lay Compore the Viokead list volue. | ] [pl exanpe: ¥ [REA eae eG eo ESSE ] = head > a oe i ~ Now zt 9 | | [4 tat en | 18 | SSE oe head © | ba here, H , Heponong node = origina! Rede : “ga ts J palindvome” a j else ie] Mr die anstog ol palindwome Progrom fon paltndrome - Dorey Ve y : Lheady Ctitley Javascript palintreme Z/Ptley L/heods | Lbedy) Fundio0 vatidlalt pellindveme Che Bia oe = = Rie ees Giles Cals El ft) fe] 4a on head [1 ( {o[z|- > NGI ina head ae ie Jae aiEt I 4) -7 ret Cey Enea full Co colcay nul ees ‘cae ead 1] fal 5 a] 5 Elst "sya oaeyon a b c a oneal n aul —— ——— head iol = I4 es sia aig Ba a are wut a pees euies Bota jell (ase felenkeais Ss eee [ran cane Wa Wats eset eG ea pout ena (FP ii- 2 ids Sls ys fot - aaa iS A £ € a ¢ b 1 jreod (ef + (5( > fe) > Te] > eel SI Ss h a9 £ iS a G b Q yelt els | Seai yd pul 020S4 OC) Mgotithee = fr stele positon 19 doubly tated, . list- SDeclane the necwaive finchon wlth Panametors Gnede * head , int data) 2 Rut Node « emp = head , eat index 5 0 5 3) Repeat skp a & S$ shite Chenp | = nun). u) If Geep a date = = alata) metus the yaderd. S) alse laderas 2 temp = Hemp 7 nent & retunn=1 e >) end* i oo & BORK an ae to convert YaFix expuersion sh pucbx expuession @ convert following nex eepsession veto past Gx __expresston- aa ) Aigorithe : - Scan +he infix experstoo trom lef 40 es | PAE the scanced chonadkr 1S an opexandl te it | sdelse, | @) Te +he paecedane of scanned operat 16 qoteater | han the pstecedante of eperatse jq the stack > Else Pop all -ihe Operators from ne Stack Which one peak than oot equal to it 19 pHecedante than of the canned operator + AF A dving that | push he second vopetater do the stacks ~ [ > TE the ecaanned chanacktr 16 an \C!) dp Stak | WIE the scanned Ghat: chorade iene") pe 201055 @ Gq ee ABCD At ¥EFAG t/ C7 AQBCDA+HELAGR 4 —-*C/ AGCDA+% FE AGH | 2 -¥ ® 8 CDN ex EF AGH / [No \Ip Nat) AB CDAAx EFA GHI¥— 1 Post Ax Eeprasion’= AS CR Al peaGue e came oo algorithm to evaluate post file expreision & [| evalude, foloing ices eXpelsion sin Stack L 454284 ¥ 22" aa j lo 2 | Algo vith | Create a stack to Store operands Cor value), |_ |B) Seon the gen excpreision ond ol Flowing Rir_every | scanned element: e 9 If the element is a nombey push if inte i stack. | ‘It he clement jc Operater | por eperods Br “the | Opevaroy From stack... Evaluate the operator & _push | the result back +> the stack. 3) Wren the Ex peision \s_ended re number in he | | Fire) oncuer. 201859 15) reve ore three vys hich ove vse “fo -fraverse ) a_three . DBn- order Traversal 5) Pre ~ordey Traversal 2) Post —order Traversed A\govthm fer Tn -order traversal i 4 Step 1 ~ Recuvswely -haverse left sublaee Step 2 — Msit soot Node. Step 3= Recurswely overse tight _ substace, + w Algotethm for _Pre- ovdey — -hoversa) = Step 1 - Visit toot pode Step 2 - Recussiely -hravetse left subtree + Step 3 - Recursively -hovelse right subtree £ 4 “| A\gtithm for — fost-order _Ayrayersal > ep 1 - Recursively havetsd \elt) Subbdnee Siep 2 - fe an chaverse. —tigltt — Subtyee. J Step 3-- Visth oot nek. < song e ‘- > eo e

You might also like