DS - Lab Manual

You might also like

Download as pdf
Download as pdf
You are on page 1of 50
RE TECHINICAL, INSTETUE, ALIMEDABAD SEMES BRANCH ot OMPUTER ENGINEERING (07) LABORATORY MANUAL Data Structures (3300704) Roadpie) Havok 04.08.40 Folly. Semest (O=34_ Baten: shift: ‘Student Nami DEPARTMENT OF COMPUTER ENGINEERING R.C TECHNICAL INSTITUTE ota stoveture (A207) Aim: Define varius tors such as algorittin, various appronelies (9 desig any algorithm, tine complexity, space coniplesity, big “0” nogttian, best case, average ease and worst case tine complexity ote Dovelap simple pagan using > Define Algorithm: — {) n crleyrithen ts delined Qs a Pleo Sy et 9.00.6. 4 6 laren Deal ocr laclamey et. pam C4 anefaettenneannyprttltertf test Jlerreshy Sheprbaavs > Varlous approaches to design an algorithm: Top-Down Approach: BottomUp Approach: Gi itfornca Yop-bown Approach Hottom-Up Approach — —> THC Nitoned tl oaks Cle lay © Gi Leupices Kyi 1 ais hgh eee Ke Ory ee wy IT Font yee TeCE VE spedit le) Lompnsy 4 Colla loved rore D Eomp lege? nmol | Fests — -> ape te sy OL Jy SuPer Mameyemonf , > Define Time complextey ~> The nt. Baisgboa if As tls. atacons,ciliionse, Q & f hs, (evn sunt: AAEM ~a-aaacancaananmneneaea eas 8S AKKAAKAARBAO Oe @ FF ta Strweture (2330704), RC Technical Iti ADOd "=o sh peue Paces fd Fe. baapudation co thee bow p by Lore inne a thes oi ak Asymptotic Notation ‘Asymptotic eotation Is « way of expressing the cost of an algarithm. Goal of Asymptotic qotaticn is to simplify Analysis by gatting tid of unneeded Information. Different asymptotic rotation: ate 0 (8ig-Oh Notation), ( (Omega Notation), © (Theta Notation), +> Define big ‘o" notation _f\ themed tol Drensers. cok the.Goc eukien ah cm eebycsthn, Ligasl Le Aire o2..mewery..oaveded 5 jean fhe pro bl ene pels tedrieds...ts.. Uygescll Me. ols Poles. sng... gulg aeithee, % Define average case complexity rmpleociby Demers culepet thon Vi the, onipet ca meme, YrOLOV RE wsdl. Dota Structure fY330704) & Define worst case comptextty re Ls fool bce Seip the Chbaxs bse Ewolaik . Meed.urg.. ie Meg nut, thet born, al youthan® vedere Qivea eg Jt ab tuctohly su Leamsenes! J... eal ON ee Sn —— LI I Din > Develop simple program a pei fou structure =) # include 2¢ } i Ze Cori ax t] Hote §}udent A Chir ewe 32) Bios Hale "(de el wn | cy, - diah> @frrveds Shend nt Cryst ‘spb fruir 69 Leterds eP the Student Glnepg C17. wens "\Foho'D) SQ, wib-ros Jzol- Gucry € 59. Shilo Mos Nagle: SI -cuye s cae | geordys wt fle Ste den rv Shreng 652 Mone") fare |e D ug tas 3 6%. Veh - was 44 Sheans CS 2, zh be, “Sy. dnc fis el C7 Maye 2 ye: & i flow Je a (cals asa senneennananae’ RC Tene Dene Seroctare (S357) (Codema Maker Arrays The aecond sethad of cephenseting a teocimensions! cecrerectaton. Under this represemtates, the fist cohen of the erray recy Iscationa reaeeved Ker the array: The second Shere ocrusiet the sort set ard so forth The schematic'c? aveokinn mae recreantation 1 hows an Figure 27, Coratder the following tao Smersigne| array: To make to equivalent column maics rescesectation, we perform the fellowing POSES ‘Trenazone the Clements of the array. Then. the renresestation wif be same 2s tat of the oe Maer seeesesniton, J acay is memesy sb the column maict oenupies the fit et of te By agslcation e! above Mectoned eee WE FLEE REACT cor Figure: Coloma maisr rearesentaton ct an array r > Write program 19 implement ary asing row major and column msjor order. =) B mclede < Sesh aeons. > a Cleclecs bled CShyp - Skt D Print The. am - 2 ce feet 2 Gigi C2" % dey fra Sees Pe GAS 2 a8 m Cf Gem i cot DEEP = bee (95 be Catiy Beers pert Bere OM The tem fe als | 43549 Amma OHPANRRAAANDHRAAARKRARAARAAAAAAAR RCTechnikol insthABad, Dota Structure (3330701) Practical - 3 Aim: Implement Sequential search algoritlams > Concept: Linear Search (sequential search) Linear Search () Desenpeian: ere A 1 Repeat For J IC (ITEM == Al 3) Then Print: ITEM found al location J Retum cxtoy having Welements ITEM the rotor tobesenrched N {End of tf) [End of For Loop] 2 W(J>N) Then Print: ITEM doesn't est {End of I) 3 Ext & Write w program to search an element within an array using linear search. else . # trclede & Stdrak > paint Pe blew bam | urna): Ink yarn 4 elon (es mt ct be) J, Sy ulpel s Flee mary cleetsf b Pant? ¢) fee tery elements 13; Ember comiy elemenlss Scand Y/Y" ho); 3 preP Cembey comuy elemertys »),; 7 Pix eee nee e Sean? C a ) Aas + Pickle Om oe clemertae fo Seter 4: Q (2 sah CY Sys Ks Pew Cyzol Ven sibh? ae 10 Catty = => Ember elereet fe feewh 3 beats Clenek aend et ‘er € rh Geno prin? Caterserls Pore a eee RE Pept sees A Ree outa Stevetyrn (99707) Brite © progeom te neerch an element within an array using blaary search. Hiwelele esddvowk> ind meine dt ovlpelt Geer mnetiof clemen bie Seb Pvp be donk, cdi ag Seerth t vnnP Center way of Clemenl9s') 5 ember Sotrbeget gent CAS Ad: 1 prnté tercmtew Fh radget sleds‘) Per (ere: Cem; cu SeomP Cay Paral)? crag). : pure P (erker the Whe Jofivd =m" | ates the vatueds Ord) ” Surf Cn 4 y AS Aeuaths 5 + Py bite | ig6h «peated ute dag h ome 6% ! medale > Cfrte bh fort Ji2; ubite CPimtige hat £ PP Cammy Pow ceed Pye miediad yy ele FP Gamny Coin) s fab) 4 enraP Cod ia Prsent ut pdee ted Im i geuh, mide). Jest: wa “Josh epeddlertt Predsia Gos b dor ty /r re 5 Poa baba) > Port A C'mb found | In" heaved = ee bine; y | 42 R.CTechnivot meri aBad Dota Strveture (3120704) » Write « program to find length of a string without using string function. #H rmcdode 2 stdrak > Pat motn ey a Chae ¢ [ood s oni ir punt Clemter a shiny od! Samf chef s3 NS Por (1293 sy ryetenaz pari cl fein of shay syd” n: aelen of ¥ cutpeks Emle cghoy 2 fpol ey Bemdh of Shoyes A.C Technol nel Ao atu stvcwure(3330704) + Write a program to convert string into upper case without using string function. Henclade eshirg sho ovtpst weld Sidra > : Bi . a : Elev a Gtriny rely Tob pate | IT ‘The Sharny On opreasé Char shrillee7 s Pint? CErleresteng 95 facta Gels (shoe | for cree SHU =e THD Le cser ti) > SUPP Ste TQ o2'S ) 4 ve ety 2 She 377 y J . 4 Pare f (The Sho g in Upp reuse deg’ iz Je Arehewes 5 > Write a program to convert string into lower case without using string function, teivclede CStdrahs | uno; HH imcdode esherph 2 4 Prd mein 0 oulpeb? Chav syrifteey Ewber arshiy | ee : ¥ prin PO Ender ashi ss): Helle oisGu, The Sieg tri Pouereie for Cro; Stef! he's reo hell Ae Csr 2” AF Str CG) 4299 ( SHO ogrela 130: y piel The Sing 1m fovenast = oles 19 sr; i te eee eA AMARA AARAA RJ ats Structwre(3330704) RC Technica! insti A Dod Write a program to copy string without ws HE tee 2s tava, ho trl mee O Chee silesd sUie04: sand Clewbey Shog sy 3c | “6 wd Pyers (he Se 0® Gy, star “fh e He Pox Crs 2 50D} spots td 4 so 2 9s | Ponvstee Pr ree ing string function. | Outper | | Enter Shay sl | Bempolew p yer y 4 sali = le 7 prvit c'shag sr aches ide Vehenes uy + Write a program to concat two strings without using string function. tmidode EStdr ab > HH indde Lshnrgeh ? ped Comet t Feber (Cher Cas fk moe 1? Chur (69. Sf Fe] ¢ part PONS ember Shay! 3"NS yes 05) pron Cl fe ele Shaya! Te fone (9 S05 d 20 afl) ata stiietine( 9430704) Ac Trdnvotontad aa pee te DaiP Ch Geneled Stays ese | si) - Wy yates (od J stig 2 to's ved ¢ wer tCohu y HCD thar 09) 4 y : loulpek int de Cape fhoy Deter Te treat 1 tSanpea ary 2S Cbd be Pe (fee OW Porn, ee es a ary d oF > Write a program to compare two strings without usitg,string function. Heipclede csrasho Ss certlShvby o sh ko tH twcdede EShMYhD Soi HP Cte vb dett tne beg tak mom 0 4 the 4 char Sti fed, sev load Anime l Sty Hequd b fh2, Pak aogull + | Pony Clem ter fort Sheary 22 | Se atts CGH). | : : Grivih (lemle Secrd Shag" ys 4 : | G+ Avy) Chevy . ge Gh) | Bence dest Ghevy 2 ae, Pes Corti shl 22 Sho pp SRD 22 Why SIr vryewl dose 8 Ost 2 shod) | A port C's bree ten then oh!) | oul pok nde fecews Cry 2 a0 > Write a program to reverse a string without using string function, H fedude zs hog h > | Shey (2 Shy Tama by fotrdude csuap> Shey {Ge aa Ve mun Ob port A Clim revere Cheng py! Cher a (2J , Jerre! Sheng j 5 teh Length : Sele pe Pret do be ae wsnrg y y : a Severe (Mere gy | otlper + berth 2 Stypn Ching) I Crk Shing fer ($3 0 6 ieee sregh ring ferns Shox (7) » Herts | Pervse Stig + ote u RE Technol nit ADO pote Structure (1330704) > write a program to implement stack with PUSH and POP operations. fh include 2sthiah> Ea fndede € linn ksh + incled € Zz stdly beh? Struc Shecle L tok fort Unsigned cupocthyt . [nl tou f Consigned carevity 2 S\act glacle® Cacebes hac le * ) maltevt (sire Gsbeet stent) ; 4 chute gheactst shocie 2 (She! slucke ; Shaky - capacly > carey; L > for = 78: ade 72 fe 5 : Seale =p uarviyy F Gab multe c CSlache-dapacrly Grae Fernhd: myth Stacles \3 | at ay Pull cg breelr 9 bor == shore -2 ca@eurly - yah ghacle >? hop zc -'s ip} verb push CShreb Shook’ shee. rat vber) ; 4 rh cs LIGlourk) velnn, Slaciy > Comey ChE ghar? bed = hems a RC Fertentorel mati A Bod Wate Servetiere (3330704) Bust Cha pobed fe Shale Vl lem)? 2 teh pee Cstraet Shicle™ gherte) i : Tf Cis Cemehy Ghats ) ation Tvl mriv, Telen Ghele (2 erry (Sheeler > Jer --J: y Ink pecle CSdaech g tacte” 5 bette) PP 60% Brachy CStatte Yeh ZUT.m hiv; | atte ghetle -2 ormny hele 2 bee 7: in} mome 4 Stree Shucle? shoely s Crtule tue le Gog Poh CShecdes tod F Cosh Oskuele 26) 5 Posh © Stutlr, 72) + pavetl Cbd peed fem Ghle im’! p. Jebus 5 - 5 Gutpets 10 poshed Pnhe Stucly te Pushed yrke ghule Js pushed inbe Stuhy Be psprtd inbe stucly Top Elevant v5 Bice s- lemerts preesnt in state -20 12 Re Technkcal Matha bata structure{3330704) > Write @ program to find factorlal of a number using recursion. Hoimclede ¢ shivehs errr r Pre Leg amb metpty punters (in md) HY meno £ tnt wd om Prd cl Cader a poslhive integer = Seah A" Gnd; Prwre C' Aicherrat of yoo sy yt y Whee, ef) 7 mellel€ Mow teular), leny tm Mell ply Mer bros limbnd & Cul ek VP ow 219 [Ember ee post bine ateger dbo nt Ve by eene -fe fe et nmol ply Mowhresy anh aaa rhew ts > Write a program to calculate Fibonacci series of a number using recursion. i; al H imclede egydenh > Pram PP ms bee rarberel elermig 5, fe we ONY any: Yerd Pramk Pl bonus (lm bd — 1b F095 S PVIMLE CPi bs mace Serres. Shab CMP RI e,m2zLHS5 | it i a4, ° 4 PEE Od ayy ‘ frre oh Pr mee Py boner y om-2)- WAZ zHIENIT: : Wthyvan 2° wien: : ni srs; Prnte & CYy.g laa)! oulpeb: SIDE [Fj ba eG) Std) Unber number ofelanhh pe 2 OM USE MIST EG inborn od 1G 233 3277 Intny 7 R.C Technical insthA‘bad bata Structure(2330704) > Write a program to find Greatest Common Divisor using recursion. FH tnclube cotdlah ? ter he A Cint my trem ay? Prk men ork we bnrne) PIKID Comber hes Pests mbegees : S Scar & gtd td | Ahi gens: Pmt CN G.en of Ved cont fod Sd," 102, heh Cam ayiy Fhe} Tob hel Cm tnt irk 4 ve (iy ze) 4 pee manip): else rétin ni? Gubpel 5 Erber lus posdeee mpage ¢ 366 Gre oF 360 ums b 15 6. Ac.Teehnico inst Abad boot Stryture(3330704), Pant TENT mseied f ‘ Algorithm to delete an element from the queue Delete (QUEUE, FRONT, REAR]: {ONT uni REAR pins the 1 Dusculplion. ese QUEUE: wn uray wil hates FR front ond rrorof te QUEUE. 1, (Chock for underflow] TE(ERONT == 0) Then Pant Underflow 2. Else HEM = QUEUELFKONT) 3.IF (FRONT = REAR) Then [Check tf only one clement 15 left] Set FRONT = 0 Sel REAR~9 > 4, Blo Set FRONT = FRONT + | [Inerement FRONT hy 1 Pant. ITEM deleted 5, {FINISHE! EXIT + Write a program (o implement quewe with insert and delete operation HP clede esddroh? At de frre ns7 Int mernt) Prk aver e(ny thet, hertz 0, rear ca, 1'y'2 1 Pah oo” ave . oo Par eee fn Ba desertion (» whiteCeny teRerian, Délelrng Ing, Display tne Pent? chen ember the choree 3°53 Sem cipa" Poy; faith Ga) " heh); feu (2 (ress) par oy ‘ 1 dle Prem Cm pueca ds At’) > 20 “pnt? c'’n ent a aM Ey ai Giedter mts ted 2 Ut) Sak Cd) fh aucce (vem 14] 7: breed) Bota Structure (3330704) eats ser) HK pymre Cin Qoeve sd ewely 45 7 cue ; - < ssiet ® Crm Neleed clomert i ded) qeeve Chri) HAS Ge weerdey x CSeses . aK i * 4 insihy & Com Beene clame ts ares Jn): 10 (fine ss mur) Prien che @ ues) exyy Ig) 5 eu’ © Be c's Prem hv gree ED Sper Pele sh ducoe OJ) perm n'y, [Enter the chives Unlew vel ote y Aztek y ie ores d cmbew the cher tes Saou, : { Erterne 2.69 eb cols | (Erber the chice ot rb meas br defeth: pend PoC lueey cheese : ver Phe chee! ui Terbir me 6276 Please see the ophrers > clemats ut v qveus 3 (iS oe - TE 974 thm 30 | \erber the che te yk Drtbed clemest be | Vonjey the Chater s quud Clamels cre} } a ae | Eater dhe chore ce (sth Ovlpeps gu ve ung Avy Ve Jonger ben 2. Delt tren | 3. Danley | 31 ergs Ee Tene boty suuceurot2330704 WAT Ntaitihin to tetete element from etreitar quent Delete Clrealar (QUEUE, FRONT, REAR): Divert, Here QUEUE (1 er ara rw elven uf the QUEU A. WP RONL 0) Then (Cheek for Uiderttow] Pant Unitertlow Uh Nlocatinns, FRONT wed REAR pos 10 the Sorat ont 2 the FHM » QUEGELFRONT] 3, TEQRONT == REAR) Then (Ifanly element «s tefl) fa) Set FRONT = 0 (b) Sct REAR = 0 4 Hse LF URONT = N) Then {IF FRONT reaches ed 1f QUEUE] Set FRONT =f 5 Uke Set FRONT = FRONT + {Increment FRONT by 1 [Lad of Step $11] 6 Pant (TEM deleted {kind of Step 4) 7. ENIT > Write a program to implement circular quene with insert and delete operation H tweled e es 4dvo.h> | Frtew gous, cheite | oy be el eon 2 torngykd be Ff de Pine mw 6 [whey eleomm* feb 5 tne queens (rer) | frt perk ae | Ente clemeb hehe Ew | Enter your chiece | (EC nley yay Chelle | r v inj bbed 70 yeh owes qucee (rnb chet) delat |r wter @lewmnt le be rset go 4 cee pente eel ghvetert) | tyler your Cherie 3 4 Pek [lewd 19 Quree ore = Fa 74, 33 atte . : q veve (neur]aelemerh | [Ember yur chen’? Ss ere FP (reer dt de rears Rea | Tie dequece Clean! ste A pat CM@uuve (ig 00% Blows baw Chote 3 y ee |. wikp en & due an > dd verre (nee LAN Se meex s, 72,12 clueve (tar) Zelemert; v - oblpe ls \ynlet 2 peep & 3. Drspley | We Gol F hota steucturo(3430704) RE Teennical insti A’bod avd donee \) ys footy f) SEP (By to 289 GG fornres + Z : (fon t > 84b sly) Ce ah ‘ \ pert Chan tevwend unde fou J] table eheree Li y " : 2 : else SB (Rawk 2 rain) print CJ. dint pring fic'ts Dee # iy Vu pair FO G3 "eu fe Yer youre ChU" / orl PC Ee i Reh te a 4 $4 creed ?) ie ee evvet ON he dew weed, clamber et ded! ar yoad Prom Jy Bow bs tas ae ts | ' \ guxP C ted --=--2 2-2 ew ooaoevaegcanr ese 5 y Gute (Chviee? else | L DprA Clin phe deae df Ces Mi «deve seid ( pli | elem Cleat) pa lqoewe(Baryy, | primal Peeks CPenk tt) pa instead ae ; fark Cig POO y | vad dyplay iy enqueue D> Woeale 3 Crts Powks [eae TP (Rgor dees 8 Sree Neweeve C)3 1 | 4 pee Cha perce ty eamply o's fronts 4 ew @ i (us OF : dy pluy 0; © yan 2 (lim elemer b 9) : van} 2 ("In elomer were ei yy ldile Ces rear) yon 05 Print P06 Jud vey 5 Ve on) ps ma y y 3 Z 35 US Js RE technical Initia ted ato Structure (3930704) Practical ~ 10 Aim, Implement simple structure programs: using pointers > Concept, A stmcture 1 collection of vanables under types and cach has a name which 1s sed 10 select at from the structure. A convement way of grouping several preces of related information together 1 asingle name ‘These vesnables can be of dierent structure is @ Defining » Stractore A stracture is defined nea to the start ofa file using a typedef statement ere ream example structure defimtion | [Notice how simular this sto declaring an int or foal “The veniable name ts st_ree, thas mentbers called name, course, age and yea Accessing Members of Each member ofa structure can be used just ike a normal vanable, but i name wall bea bit fonger To retum to the examples above, member name of structure st ree will behave just hikes nomal aray of ehar, however we refer tot by the name Since selecting a member from a structure pointer happens frequently, i has ts own operator ~ > winch acts as follows. Assume that st_plr ts 4 pomnter fo structure of type student we would telerto the name member as — +> Write a program to implement simple structure using pointer. H imclede csfdvarh> tt tclode Zo prey? - Streck sfudeap 2 one ds Chae pune (32) 5 Prowl Peron jose; 36 y RZ Technine tee Ae = 2 jeb prin ed wets Shee Shocck Squdere Sidedea tt 2eerd, §$ yet; . i preveP ¢ Pewrte cf sted 2's prme CDE pp sie™ phy 2 33 . t . . Pee ¢'Pesimmyesss fe Pf Inie! PR 2 prachgy. a (Yet 5 vd cubpel: : iids fre D> Pave Peres hege I +Ge, feve cs \ a7 RC Technical mitt A'bad oto Strueture(3330708) » Write a program ta insert o nade at beginning and end of linked list. 4 POP reer H Proude Ziegfream > Ubingiipremeg nate stds Ve pal Cived o% thous of, ine Wow —deley L Rede wes -nade 2 ew mle 05 aMed ee I Yule > Wew dela 7 i vedo 2 eR sO hen a) VP "hed P J = Meas nade pee ‘ Z fhend ; [Tmj-> Ri J-> levy GPT] -> nell i Delunee \rap le ' herd - ef = weu- mde TeAd urns 5 Gar le Glass 2 ex Ls pel Las} > bagh ~9 Werk; G ayp ~ 2h = Mewneds > dhe + vod [rset APO ved ued 2 hyveu. do br) (Cf Greve, 2 = My 4 we in ceel C The G9 Prewoeys wale conmt po pels). y yt} PAC Wee des Wee wide 0) Mew pole -2 daha a Wee -de les Ned petted Way f= [PHY “Pe > WED, (Mt > mele 2 Parks Wi ~ rede ede) i: Vad appet Ched “hed 16,» * rey debe) RETechalcal ntl A'bont ota Structure/3330704) rede * wer, we per wade (25 wole* Lak x “het - eR, mee we <> dubt 2 meer - duby s Weert cele 79 per Aol} TR (Theat Pos ell) Y pead, WE a new -rede | yap: Udhle Clusk Deveset ) erell d ture o ley bm? Verh; Lash —) Wee t Wey -wode? Athen! Verd pada t dwod eyed) a hie (rede) = wits a Are fuk Ce virvders day ; y wede = wde —> vet y Pn mein ey pods Peat awl: coppers (Eb A 6) 3 pur oGherd 3 Upped (4 hee, \asodaflr Ched -2 Web dS lod Cl yoebe bee nay prt Crigs 2 peed? Rider es 4 43 SPIVPVIIPFPVIRIPRLRL PTI VAAIAT ATT AAA bata Structure(3330704) RC Technicel bith A Dost Practical - 12 Aim, Inyplement insertion of node in sorted linked list > Alzonthm: Algorithm to Insert new node in ordered linked list, INSORDIX, FIRST: ~ ga finan tnertt 9 newelement Xintothe ordered bnted fst, = FRSTis opeanier loc tive eddeess uffen made i Une lak, 1, ICAVAIL = NULL [Check for availability stack underflow) Then Wote (“Availability stack underflow’) Return 2 NEWSAVAIL [Obtain address of next free node} 3. AVAILLINK (AVAIL) [Remove free node from availability st2ek] 4. INFO(NEW) -X [Initialize field of new node} So IFIRST= NULL [If lists empty? Then LINK (NEW) NULL FIRST--NEW 6 INFO (NEW) <= INFO (FIRST) [Does the new node precede all nodes in the list?) Th LINK (NEW) —FIRST. 7 SAVESFIRST [Initialize search pointer] & Repeat while LINK (SAVE}? NULL and INFO (LINK (SAVE)) =» INFO (NEW) [Search for predecessor of aew node] SAVE™LINK (SAVE) 5. LINK (NEW) LINK (SAVE) [Set LINK field of new node and its predecessor} LINK (SAVE) NEW, 19. Retum (FIRST) ished) > Write a program to insert a node in sorted linked list. # tnclode Cros bye > Using Mumeste SJd + Classy rede db peoples nh dake? Mode “noe / 45 yd Serkt Tosert Cod o fead yee Med a *~ pee wides S@® Qa Gt HARA AAR BA ea ae eA @ = ~ AE Fete tant tant bane seveeturah ADA Jal fagerl Qhent new Oe) wode a pres dyle od» Jed Inge CB had rer ned 5 Wale c (vec tvade @) 5 Fed fog Cf ad sprees pede) Jove head d leaks da} lw 7 hob (pets meyer a) 46 RE Technical mit A’bad ereatesinglys inked sat (Head) sine (neato HE (nevtiade o> WAL) then write ("Umatte to allocate memory. ") tea Hse than reat (asta) ewmode.data date teap © head For (22 toned teep + teapsnent 14 (texp o> WILL) then break tnd fod for 16 (tenp t= WiLL) then entiode.next + temp.nekt terp.nest » nestente toa End else tnt ate Stavetine (2330704) > Write a program to insert a node at any given position in linked list. HH Prclede Zios bau > y tv d y det get ved ee Girh dete Using numecince dtd 5 Shrew pod ed (vp dulut Stave bh pveclc * pow; neu nde 2 Wey WdetIT =2 pola >» dul > prend s poll; 2 ped rev nie poy pod © Athen warned es 49 PDPZBIIS*pnvr PF R<_sP HPP HPHFRP RHA HRHRQBRA De Boe e eee: _ Reta a nae smeseninenis ; hie Bed Pb Cede ® Agung ma pos, brs daby J VE Coser ir ge $176 HV? feed ga ‘ Jaw J pose” yy and ty elt Uile@a.. 57 TE Cpoy redid rede “Jeme sc sidnvod ¢ Chute) 5 deme <2 perks * Coren, Comert = ferme’ J cue cennt = 3 Ccomrty H2 EES 4 y Stich: ao pink os CStrec | ed «heed ) ‘ Y ic poltZ 4 “ while Chege | 2M oe goof 4 ce ped 9 hie pave s bee’ 9 peerk | coor deanrd)s a Ps trb meth 19 d peede* heed» well hese = Sed Mode ®; ped 2 tal = Sat nid € (> f ee ae eo: foo werk Dre mo “re wmee be 72 Ace ->meth = (ebnids Ge) aa) Cine cho 50 Co \ RC Tecnica! mith Ado ota Stuveture(3330708) ce Binbeas Jae beh Taga bien” prwebak Chea) i fab duly sia Pars 35 Pesta b ets OG hed, Pay da bu dS took de! pinks (dee ad How py rye Peiey oP J Peg hire; PrMb- cbse het ) i de he 2 eet Prse b ped (herd, Pos dele) 4 7 lee} ge Linieed Lod a Phe prucherof latpy deals, par) kat (peut) 3 daly 2's Pes eo} | yrs prs CR heed, ted dota > cout 2u't Linders Lab Of fer Moga t fem of ipa 1 pasted: prom kb fuk Chews) 5 4 y ' xthen 25 st ~ 7, 7 To eee rrr er eee eT VT HF TF EEOC TCT ECCT FFE RC Teehnicel inst Abad ato Serta (3530754) 7% Algorithms to detete rprcific nedte from linked Ast, DELPOS (FIRST, X): Tho anes tee m mete from eet coment te i FIRST ana penton whch cummaams adres f fat poe the at AL OETIRST=NULL (Check for expty tf Than Wie List tn emmeny Rete ICLINK GFRST)= NULL. [Ifsberancoly cxenede7) Thm Ye INFO\FIRSTI FIRST +-NULL 3. tAvopnne address panted by HIS! poster tn TEA porter) tea esesens ore SS ome rede} TEMP FIRST Je LINK (TEMP) # NULL and BMP # X17 Repeat PRED-TEMP Ter 18 (TEMP) 4. TEMP 2 X [Node found] Thm Wate("Nodenot found’) ElseV—INFO TEND) LINK (PRED) LINK (TEMP) SS Rewm (FIRST) [Finished + Write a program to count .search and delete a notte (at any piven position) in linked list. Bb imchde 254d hh? Se} irclod 2 Joy reer 2 t are Shae Struc) wade L “nh dulas Glrock pores Mg pene Se ! af (Start nde)) AC trchonot nA bod S)rpid rode” Tr) Quwiso wn ph Mendy tolvie C med tell Jovi ps domed Wor 4 form bh TES i Jn sunset 3070) veld devele prod ¢ Ag Shier be bee Any obs eb wep od Need pide T ferric t Tad wee “Pty BP (qemp peru SS fore so dele x Woheaseyel > lenp ar treer: free Jomnys ye 2 then Leul seuaeh yvode Cotret dG ~ fort Sabet MAM end 2 hurd Be Lwhta Genel | enelt Dh (9G. Careers ng Cure 2 weeks ee bh 2 aden ss beer seen Poet > J athens | Yt Nor) prvlbesb Cpa tk wade poder ys Lifile pada l sels J Go) € greg r-o deve ree des bode ~2 rem uy tt a 2 y Y Mh morn Oy C1 Pode ~ hed: well bres pel wh, haley y 5 Lise _..anmnnaneeamereaaa RG Techatenl uti Abad ‘Dota Structure (8330704) Cour de! Tall oe oPivadas a did Gents ( Tool te|m Dler dalelenag com Clomees be") dette mde (A herd, 33; Pymilsa (head: Prd des. te Peasy: PP (hewereh prod oc Bhend, ede Pedy yh Couk se end Ce ema de Pee ced Promo lt Yeney Coulee emil sé § ” ¢ tlea. be. free cet it bet fone" 56 RC Teenmicol math bod ete Strecture(S330704) ebm 5 UPTRINEIENULE PTR ANEW) et LeTR(U NEW LeNEW Return = Write a program to inserta node in the beginning and at the end of doubly linked list dE trclede ereytecum > Uviwg peoresnate 54d; Clas wed f zl pebhe: Cnadad? = pede Tex |! fade * Prev? yt ver efeh Cired te L veda * perros Wewmete DG = fusartd ret, Dob wee dort D wes vdittey Lobe 4 wth prow pls -2 % wee 2 pedo 72 WS Pree; — 2 de pew 2 melt? Ve Cheer y = wel Co fread 2 PY > prcu = Meerrrade? ord insert AFfer Cid ¢7Pre rede + \ ek one fine gheon reese wed camel eons beeen Gules atten 24 ere LL ee ee a ww 0 RC technic! MELA DO botasinyetuce (1190204) 2 INFO INE) 4X{Cony tnformation field] 2 We NULL — fincortion into an emptytith here UHH (REAM) €-IOT HC ENE) GRIT Lenentw 4 EME fot mowt ansertiont FTA (NEW) NUL WOT (RE) OM 1TH (MM) NEW Lenn LTH (EW) ELTA (MH usu in aide) eve (NEW) EM EP (MM) MEW fm (Pt REWI) EW Rewwin » Write a program to insert a node at any position in doubly linked list Ht Incled cet aytacem > 4 yord append (ved e “ jeer wind py. deaders d Ned ¢ * pegs pul © ve a pede a: prod &7 Last per ES i Prensvole ~2 dla 2VER —# ee ee ee rec" fe wPes wll) de ~2preu -nwll are we pede r frend: at o evry — [vbe-t atte e y Re Technet mA bod Desestracrere (520704) Pracii Aum_Implement searching of a node, defete 2 node and eounting no of nade algonthms in doubly linked list + Concept Aigorithn to delete node from doubly linked Est. DOURLEDEL (LR. OLD}: 2 Tht eetion mgerts om element nto double Hele bis epomeer mbych conta ecbest of left enact rode seit Reve poarcer wtoch cores odtoest of rete matt nace m the Ea. © OD eertent edsrens of pate ntich we wart te eet, Re TRL Quadertet Then Write Undertow? 2 MLR [DeleteMade} Then LER ENOL Eset Oa Then LERPTR LY LPR (eNULL Ever OWeR Then RELPTAIAY ReTRIRD CAL, Else RETR (UPTR (CLD) CRPTR (OLO} (ota (RTH (OLO}} CAFTA (OLD) 2. Restore(OLD] [Return Delete node} Return > Write a program to search, count and delete a node in doubly linked list H trclode 254k CHAD USING Mame Pere OY ; Class mde “ pebhie ind Jebus Wed 7 Wark: Neda" pte at yoid de lake Guede ® “lee ef rete A419

You might also like