Download as pdf
Download as pdf
You are on page 1of 48
rrr reece ere eee ee ee eee eevee EEE eres EEe- eee eee oo=3 2 ||Prray- 2 « |aK is 3 contiquous memory = allocation. - ollcestsin sametype of data elements. 2|[StaXc_memor ai\oostion( xed len gin) 2 [Srdexing = Stet rom O Stork -from 4 Start fom 5 2 || Contiquous memory adlocaton— Suppose, wetook an integer type, with 10 Aements. ~ Zn int type td clement tsk 2 space In memory So, 10 elements willtake=\10,2.='20 spaces in memory. some datais stored! "st hola spaces = wih ~xemain ba ati oe ze S mb stoxed : Now, we need -to steve 20 spaces inthis and nis con orly be stored in Bomb, *|iSame type ofdata clemeris 4 ist = integer Jeher = character Static Memory Allocation= Drawback- Cemnct_chanae the size of an arvaute, We cannot Increase or decrease tt atthe wun Hime. We need to define the size of an array |at—the starting ofthe program: 5 ] [Eg, We need-to store name SATAY’. chav af103 Iai Jah] TT TT 1) eT ene ee 6 spaces will get wasted Defining an Array- @ Ink ACSI = £5,8,9,6,2% 6 42a 54 © Index. 5 |e ls Je fp], 110 Gresered-this-this point) Se mae Memory ‘i ret i fast Bema is on 108 “but end ptisado. datatype = " - @ ane acs” Size (Using print? andscant Amines wewlll store elements) Oi Ae wt, re 8 8 Ja lalalel elo inne : 4oo 402 ae 106 108 ® Opevaona on Array Ineevlian= InsercHon ty \ocaon= Inserlion by clata~ © war 45 6 EAey by A) or Tnsevtlon can tbe: clone bry-two wal stovidling clata (meal ¢ at 7) ‘ Suppose we waril lo Inserck vam elernerh vox 4 (s|zVa) els ]214) arPrare 6 Wwe a “re locaton, by pro | On tmeans~ at location % we want-to insert A) __ Sear aiing- Linear Search, - Binary Search, Ternary Search. ¥ |Mexging- LL) Veal Two differentarrays | As Aa memqed +yform a single =e] , | A array, —M [Traversing- DeineinO £ int aAcsd sts fox GOs 6 S344) Tasecting element i, ye scant (“ods ZAG) _e xead 3 . pel ssBy fox (i= 03 1455149) L painted, AIDS < write z S Displaying clement return} % In void, we don’t needne yet aimee ty inks We Need to Yeturn some Nalue! . insertion by data- If itera 0 be. InsertecLatter. element dats Fox CG=0,te55i++) < Z searching process | _ ACI == dats) t pos=ty break} } y # - Fox(iz n-a3 ils poss t--) Gistsisel ; o 2 33 AS Vacant place t Ali+a]= AC; Bice iP we want-to we have to pur G-syh) é element Alpes fem} loap. will sine BOS Se =2) (2\2\5 12 3) 13) We want-to insert an element2c= 10 afrey-the ata a. ee [Final [a \s|s|3 Is 2s b3| Men We Wi search the clement 9. Stepa| We will Increase the size of the array. Step4i Steps seri - Then we will shift the element 44 by 4. } Insert he data st (ocaton +2). FUERA NCCES Wwewil get duplicate values. Atthis position we will put — [pes+4] = 2 Then, st that position Ht will Walue of >) get OVewryite. [+ |3)5|a|s|o[u] 2 Insertion by lreation= i teserk clement item at location pos: Fox (f= n-23 tle possi-9 gt Atixa=ACiI 3 t ALpesi= ttern $ Deletion by bata- I element dats ts be deleted: ; leo Pte O3t<53 +4) r i H(ALI==datat £ pes=tS cenit brdaks | 2] $ 5 Fox (i= poss i A000*LA-d) x2 = .19000+ 18 = 1018 Ex.g- a55...-.5501 BA=990 4 size of element= 108 LocLalasell=? 2y aqa0+[450-55)x10 >> AQVO+ BASSO = AGO. [2D Array - iota... 47 £3-.-8) 4 [442 aan 223 day a peck 2 5 xows columns 2| 821 As. daz 234 aas|_| 3\@s1_asa ass Ax, ass 4A aya Baz yy By + _CNo such Yepresertation is Row Major- herve inthe mernory) xow 1 mea te 7 row? “ Column Major - baba tweeted scolurn 2 solumn 2 Row Major Matix - Loe fa caic3i] = P BA= 1000, Spaces 2.6 BA+ C(4-4) x colurnn4 (3-DIxc >||4000+[ Sx5+2)«2 =>||1000 4+ 34 : sxOpjaZ sul a 1034 LoeCataiCell=P My BA +[CQ2-Dxreclumb + &a)x c th AS0O+ [ Ax5+49 x5. : 1000 +Lan2] wha 1018 Q. ||jalas.... 35010 80....150] BA= 1000 , C=10.- - LocCaCssollaaol| =? No.of columns= C250-80+5) = Fa BA+ [0550 25) x no. of columns+ (140-80) ke _>>|| 4000+ [ 525x54+ 60]x10 => || 1000+ 0342550] . =7| SA4350 Q.||al-as.... as I[-50....50] Ba=o, CHa LoeLarac} [307] No- oF columns= (So = csosh =. 104: ~ BA+[ (20- (25) xno. RcaNaRSe SO ‘ean =|] O+T45x1014 Bol xa =>|| 4625 Loclatitjl= BA+ [Ci-tb2)xno. ofeol.+ G-stbay) xc AY Ga. S10 A235 ny Sic Colurnn Majox- a ote. s @a1 Sar S23 Say Sag a B|S31 23a S33 S34 az5 abe Ban S43 Ay Ags) BA=10 ©O 2 | LocLataitsil=? 1000+ T¢S- x44 Cac) x 2 1000+ [ 8+1)x2 i 2 1000+ 18 = oe | 1018 Loc CAaL4iCsi)=P 4000+ 0 (3-Dxa+ (A-d)x2 4 1000+f 8+ 3]x2 | 1O00+ 22 doa2 LectatiI Cjtl= Bax EC BB Addyess Calculstion— als...9) £45... 35108. ...50], 8 4 +h BB Matrix Represerta- Hon Fy rR 50 — aL ats...c) [4s- aS BA= 1000 » C=10 Loc La ttsci(acll = & Sa J IS= 35- ea WNo.ofows= 35-1544 Do. ~ow column sada Wo. OF cclumns= 1000+ CC4-8)x 221x434 Sune 5O- (Bo-38)x 43 + Go-B)xt0_ SAE*t 2000+ [4xa1K4sx 15%43+ 32} %10 43890 Linked List - Fddress oFancthex node YSEDET node Fincton- Prototype / Funétion BefRintton a Calling Retambupe, Body t Function name is “Raeton, _ Gerameters) ' =Faneosc 5 : t a 4 5 == __ 1 Body CE should be. insiclesthe — J function) 4 1 \ _t|_Cating should be inside “Whe main. Umaind) tL — — a calingQ -| Prototype canbe defied anywhere inthe Program: : >|, Prototype a Z. main «|| Fctovial Progvam- wecursive solution vi. facta { REO BetCny= at Lelse nrack(n=d Keck)= Ax-Sct® fark(a= 3 xfeact Lect (a= axfect) [ Bet(d) = 1 x-fact(O) SctCOy= 4 b= 43x 2x1 O = ( ne * |Pointey - matn 0) — pete = value _of node _ = whose address 40 it holds | 100g) kay addvess fa Fir 000 ° ||Structuves - ||| Stove _diffeverst type of data. Por eq. Ea att Sino, Rolo: | Ackmission No. | Name a as 3 4 5 [SINS Row Ada Name ECT EI rE Peeceeet Example - = aa} : ul = struct student — ic int SNo. $ ebay pamela]; = 33 — exloa lao] Without Pointer. - 7 msn £ Shuct student si print C“ Gster age”) scan C“ Ted?) &strage)} Brint¥(“ Gitex name’4)$0 fe Sceanf (“Slos”’, & Sasnamd3 ssinstf (< Exter sal)5 2. F Eee Bal scanf (“lo F”’, Asa.sal)3 2 4 ae ink maindd < ack student &4)% pr Ptr= 2545 Print (“Extey age)5 Scan (‘*Iod”’, Apt age)} “print? (“enter name's Scan fC Fos”, & ptr> name); Print? (“ Gxter sal”); Seanf (fF, & pts sal); Yeturn 05 I Insertion at begoning- wo condition fox Ht—- gy Linked list exists ay Linked Nst does not exist: Linked list does notexist— [pe wl] EF \inked list does net exist then poirster the who has addyess of Rist node will be a Nut. iat oz=8 * insevt st beg (stuck node * Rivets. Ioteuck. rode insev 25, ( Seno ic Shuct node x pt 5 P= (Struct node *) malloc(size of(ehuct Revdée)); Wf CAiyst== NULL) _ £ Bt datas nom} Pr next] NULLS Ayst= prs return first 3 else t 0 Psd ata=noms Fs next= Fivets Fist= pir} xetwrn Firsts 3 Insertion stend- struct _nodex Insert at end (struct hodexfirst, inst Kum) ft shuct node * Phy xcpt= Brsty BY = Ghuct nodex) malloclatze oF (Struct node); ee os BS data =nurm 7 PIS nexk= NULLS firsts next= pres etn (AYSD) t else whi eE pts next b= NULL) Lo cpt= cpt next § pra dats=num; | pre next NULL} eps next=Pt; | return (fists Insertion anywheve in linked Net (Mid) - | oR = cEty next; HEEL + — LE Copk a next= NUL £ a ay | Metsu SET soe See 3 ; else tL pradete= nom; Pied next= cpt next 5 cptsnext= pty xelurn (-FY¥st) 3 g $ Tris a two step opevation- : Get he \nk ported by -fYyst sarin wai Vink stmick node delete first (stuct nodex Fist) L WF CAyst==nvuid i vt Prineé C4 Nothing “to delete™5 g elseif (Fists pect ==NULD £ RreeCfys)3 FAwst> NULL veto Cfyst3 3 else t “Riel = “Ry st nexts yetorn Cyst); Delete Last Node- ICasei- 4 node Case 2- multi node Case 3- O node. Case3—- |__-Fivst (NOR) | nowhing aw delete Case 1- vst [7 a S [Noul soc Case 2- Rest (E05) ar é L co galete")s Bris? (A Nothing 2 S— + zene __dseif (Ast 2net £ fee Cfrsd3 “Auets NULL yet Gays) | 3 else L While (ptr-anext = NULO) £ 7 . oF opt=pts Bt apts next j t pts pect =NULs eee stv) retarn CRrst)> ‘ + sal ’ IF Delete Any Nede- Case 4- First [NUK | Sivct [255] Fivat HEC) ici {ces 5 eet | elseif (Fick ‘chagtey £ Pesta INULLS cBtonext= pha nexts _ Reece) _ veturn (Airsh)} % $ Insert at beginning- Case 1- FAyst fou) 400) nid: aco fF ee \case2- First ico IN| fir: ME | Fixst [400 IN[2< [20 {N ja | N node 54 Thebeg (Stuck node 2 firsts int ns) slruct node x ptes ae ~ BRIRtE(@LinkedList is empty)s (ptrs dats =num 3 _Ftropreyv = NUL ptr > next= NULL; | © pits dats =nums pire prev= WULLS oa : a= Firs next= Ast Est > Brev= pry ust BY yetien Cie sd5 Fist next= pry vetwrn(-fyst)) z Ee else Chile (apes next b=Nuey) __— £ cpt= cpt> nexts prrodats= wm} Ptronext= Null; prt pres opts eprpnert= ph xan (Ryst)s 3 is Delete Sxvst— Fivst = ptr > next prreanext = NULL fest > preva NULLS Reais) 5 Delete last- pea prevy>next= NULLS pied prev= NULL} Reece pth | Bir hext= Ny Ree(pt)s Doubly Civcular Linked Uist - Insert at beq- L_ pts next= fists PY prev= first> preys _ LAst> Prev= ptr} ya _prey > next= pi PAast= ptr) Insert any- pst data= nur pi > prev ost ste hext= cpp next pts next= pies > nexts preve pis \ Posext at beainning-| . head, soo J [ses ¥ | Hes 7 [soo}—jJa Jo _ ~ 400 200 SOO ol a \100 — struck node mi — C intdstey stock nodex next 5 500 \ a : newnode struck node heacls%newnodes 2 Rewnode= (stuck nodex) malloc (size of (shuct nose) Print C“ Sater date u want to insert #7205, scanf (“bd ”, &Anewnade-> data) + newnode Snext=head + head=newrode} struct node L int datas struct node * next 5 struct node heady %newnode? ¥temps hewnode= (struck node) malloc (size of (struct node) 2 “pratt? (“ Ghterdata U want to insertt 7) 4 : i Page. ; ea j scanf( “Ted's Anewnode> datas newnades next=03 -temp = head while (temp next b= 9 L_ -7emp= temp > next} 3% | temps nect=newnede} nsert after aaien locaton - Int Pos, i= Struct node Sint dats; struct nodexnexts 33 stryct poder bsads SSE TSP print? C“ Entey-tne postion 3 aaee scant (“0a 2 Pos) 5 i t# (fos Peourt) L pest Ci Tnwalid Poston’); 3 e\se { -+temp = head} while ({< Pos). {_+temp= temp > nexty Ubts 3 Print C4 Geter data? )s = Scant ed, knewnode> dats); A newnede > next> temps next Z temp > next = newcode}. = 7 WpeleNon fom Weed tet | ghuch node F 3 an |X__ Ant datas : ace ar _stwe¥ pocle x nexts Sear aecHEEe : —- 3 oe i Delete from Beg (> epegapusa ms - : print (Node ts empty stuct pode xtempy | cternp= heads head= head dnexts fee (temps ie 3 : 7 stuct nocle I< int datas strict node next} a5 stuck node * head, %temp} Delete fom End C) {struct node Prevnode} temp=head } while Ctemp > next $= 9) £ prevnodes ~temp} temp= vemp > next} + 2 FF Ctemp = = head) LQ head=03 + _ else estes setlist! ~ —. { prevnode Snext= 05 i fet ie 3 -Ree Chemp): “< See eee ria $e struct node 3 L int data} Struct node * next; 33 Struct node x head, x+temp} Delete rom Pos()- £_struct node ¥ next node $ int Posy t= 45 temp =head3 Print € C% Enter Postion!” )3 scan? (ff Fed") & Pood} while (i< Pos-1) L -temp=temp > next 5 M45 z extnecte =temp 5 next 3 temp next = nextnode > hexty free (nextned e); is Implementation of Doubly Strict node Lint datas ~ struct noclesenexts ~ shrct nocle x prey} 4 33 3 stwek necle x heady mewnod e} Jt heacl= os stuck node wtemp int cheice"44 | newnode = (ctruck redex) malloa(szeoS( struck no de 4 Pret“ Enter data? 5 scarf (“od”) Snewnode Pdarte); i 3 Newnhede> Prev = 03 newnode> next = 0; if Chead==0) L_ head= temp= newarde; Z 3 e\se Lo temps next=newnodle} 3 hewncede > prev= temp; temp=newnedies + Print (“Do you want te continue’); ‘ sean C“ “ed”, Schvice)} Noid display () {struct node xtemps ctemp= head 3 while Gemp}=9) { Print? (“Ids temps data) fi temp = temp >hext; a t wl Noid maindy to ceste(); display O} % Geter Cy Deeg eeteee eee ate ee ete q shuct node s - Lint datas sbuct node x next; stuct node * prev; 3 stuct node head, xtaily void creste DLO L struct node ¥ newnode} hil heads 503, Intochotce} {| Remeee Pune malloc (stze of (struct node); printPC“ Enter data: ”)5 scanf “ed”, Rnewcode>dats)} Newnede> prev= 03 Rewnoded> next=03 tH Chead= = 0) L__ head =4atl= newnsde; 3% else £ tallsnext= newnode; newnode > prev=talls ASil= Rewnode} if | print? (Bo qou wart continue™)} ScarfC* Tod”, Kehotce)3 Noid display() £__stuct node x-temp 5 ctemp-heads while Gemp d=) £_print#( “ed”, temp» data); ctemp= temp> nexts «. | 3 Page No. mel] Insextion at beainn | struct node {int datas stuct nodex next; ct node preys [3 head, «tails void insert atbeg 0) L struct node % newnode 5 newnode = (stuct node ® malloc (size of (stuct nece))3 print? ( enter date”)s scan¥ (pd, Anewnode>clets)} newnoede > Prev =O newnode > next=O$ head > prev= hewnodes newrode 5 next=heads head= newnodes g Insertion at end- struct node Lint data} stuck nodexnexts shuct node* prevj3 3 sthead » tails Noid insert at Exd OD L struck node * Newnede newnede= (struct node) malloc (size of (struck node))3 paint? (“Enter das”)s scant ( Tod" Lnewnode> dats); newnode> PreV= O§ newnode PNET =O3 | eee eeeeeee Er Aalls next= Newnocle t pesnede prevail! tall = newnodes Grsovtton “i Rseve aPtey p FC pes <1 and pos > Jength) _ DL printt Cf Twallcl Position’); 3 else 1 (Pos==1) 7] Fox {Insertion after position, {insert atbeg Oi J we will not write this We will 3 Awectly roveto else. else ZL struct node Snewnades setemp; ctemprheads newnede= (struct pole) matioe (sthe of (otruct nodes printf C8 Grey data)$ ScanF C# eA & newnede sdatsyj whiledt< pas-2) while (i< pos) (insertion L_ temp= tenps next : &fter position). ets £ Newnode-s prev=temp; newnode> hext= temp > nent; 7 temp next=newnede} s age Ho. | ue [| 3 Delete from beginning-| Noid de\-fromBeq () newnecle ~ next> prev= newnedes_ 4 4A Vi Lo stuct rode setemps if Chead== °) £ print? ( “ Usk is empty} $ mp} prinisc ae Posttion’?) seant(“R3, & Fos)} else while (1< Pos) oo & _*temp= heads LT tempetemponety head= headsnext 3 tray heads prev=03 3g i Ree Cemp} temp prev > next=temp ¥ nat | Delete from end wold dei-from end 0) temp > next > prev=-teme Ss Rey Free Ctemp)3 £__ struct nodex-temp} z “i tf (hail= =9) L print? C4 Ust ts empty} $ e\se {L_temp stalls tails preva next =93 Sall= anti preys Ree Chemp)3 Zmplementaton of circular linked Uist ——_+ : 7 sruct nodle Cereation oF cinaulew Lint datas i Struct nodextnexts 3 x heads Netd create Clrolary LLO Lo shuctpodex newnedes x -temp 5 Sad= 03 intchoiceE 45 Lnewnelle-(Shuctnedamalloe( size of (struct nede)) 3 printf (“Eyter date”)$ sceanf (4d, Snewnodesdats)} peanode > next =93 { \Sad=feme= newn ocles $ e\se 2 temp-snext=newnodes J -temp= newnede 3 temp > next= heads Print £ (“4 for continue © for extt)5 scanFC% Tod’ &chofce)} 3 Noid A’splay O 2 struct ede x -bemp § if Chead==0) £ print-+ C&Uestk ts empty); Ss e\se tteae SHea st \=head) L print FC“ Sod temps data); temp = temp 5 nexty Al Fonintt (“Ted temps datas \.\ Page No. Date J [estat ag stmct rode | © int datas | __ structnodexnexty Stil; Noid insert at beg6) \\\\\\ £__structnodexneunode > newnode= (struct nedex) mallee (size oP Cotuct node) PUNTA (“« Erber data) scan? C** Tod? Knewnede-> datas Newrede—next=05 H# Gall==0) L rail=neuncde3 call Snext= newnodes & jc\se L nawnedednext=tStlS ext} ASS next= Newhode; So Snsert at end- stmict node Lint datas {Ant dates stroctnode* next 4 3 eral Noid insert stend O LV struct node xnew node} newnede = (struct node x malloc (size of (struct node)3 Print (“enter dste”)3 sean? ( hd”, & newnede> dots)s newndde > next= OF If (Asil==0) f cal\= newncdes 3 a ob a { newnede> next= Aatbsnext; © AailS next= newrede j al\= newnede} Rist datas sStuct nodes next Bactalls roidh insevk st Pos) L_ suck node x newnode s *temP3 wk Pos, i= 25 23 paintt (“enter Poe )5 scant (7.0754 Pos)s L= getlengthO) i CPos next= tempsnexts temp? next= newnedes ¥ Delete rom ct node errck node, Yi im dates = K inst data; I] strsct nodex next struck redex next Seteils Betas eid del FemBeg() Nota. det frem End 0) & struct redex temps £ Xkack medexcurvents ~cemp= tails next} FPTNTOISS YF Geall==0) Corvette Sneek Dpaate ( Licks empl )s fF Gaile= 5 : 3 T printé (“Usk fs Gopi else IF Glemps next== temp) 3 £ an-0) else if (curvent-snext = = Gree emp! cuvvent) 3 L4all= 0; 2 ele Fee leurend} a PE fail 3 next = temps nects 3 _| FreeCtemp} alse | z T while Covert next} = | z atrSnect) Tpesious= curents COrrest = abrents next} F oe PIENOUS Spoke Saths perks : Aail= Previous; Hee Camvend$ 3 ee vaye veil del-form Pond) Lostu ctnedex currents % nex “noche scan (“ody £Pos)5 Lx get lengths E(Pos< al pesSay L printt (Tnwald Postion); re\s@ tf (pos== a) — L__delfrom beg (}$ - z - else — ~D while C= Pos-ay Zo current = current snext § tet & nextmode = current snext 5 current > next= next node > paxti Free Cretnodeds z PlementetHon of doubly Cyculay UL struct node £ tnt date; —_ struct nedexnexty - Struct node ¥ prev § i % head, ¥tall — ——— void Crearte BELLO ~ a shuct node xnewnodes _ head=o} oe Rewnode> Cater node xy MANGE BEEF Cele TREE) }- Paye NO. Date | VV} Pant? (“ Gyter data”)s Scanf (40d & rewnede> dats)s if (head== 0) i_ane | & head =+i)= hewnedes headSnext~ head} head prev = hea d} 3 else £ tells nek= newnede} Newnedesprev= tails hnewnode > ne xt= heads heads prev=new nodes tal = newnode} [Display of ad oubl F Noid deplayO struct node «temp; temp=hea dj iF Chead = =0) L pratt Ustic empty); 3 else £ while Gemp}=tail) €prite C$ 0d’s temprdat=)5 emp= temp > next) 3 prist# (“Il ’s temprscats); $ g Tnaaron im Doubly Circular Ingert art beginning = kg Se elF ay ——<— ae struck node a “ghost we dowenarts — — |B beady tats |[Notd insert at Beg() _ nalpinode=(gtuctnadex)ma)ite (size ol anctred dy “chuck nodex prey} Pn a EE chuck nodexnewnodes | print? (“Enter date”)s scan? (“ed Knewnode> date)s +f (head==0) | { head= tall= newnede; newnrdes prev =talls | mewnodes> next=heads e else £ newnode> next= head? head» Prev= newnodes newnode> Pprev= aa -tatl > next = Newnede} VQead=newrode} stu {int datas struct nodexnexts struct node previ we heads xtails Noid insert at end O L__stuctrodex newnode} ewnode= (shuctnedex)malloc (size of (structnada} print’ C“ Grtey dsta”)5 seanf (“ody K&hewnades dats); tf (head==0) { head=tail=newnedes hewnode —> py¥ev =tail} newnede> next= head) S else Po newnede> prev= tall} tall next = newnodes newrode > next= head heads prevsnewnedes stall = newnede ; »EHsert at Position= _ pale ardent Sue Neds Mp. aeicbeme echt — £ ik datas —-— —~ stwct node next} _ aa struct node * prev$_ ——s [3 heads tail 5 _ g |[Nota Insert at Pos CY Struct node newnodes * ‘hemp 3 a Print (“Enter Pos’?)5 ink Poss tata temps reads Scanf (“Ted & Pos)5 L= getlengihOs tf CPs <4 Mt Pos>0) £_ print? Invalid Poss else if ( Pes== 4) £tnsexvtat beg 03 § else t newnode = (stuctnedex)malloc(stze of Gtuct print tC“ Enter deta”’)s Rode); saan (“JeA"%, knewnode> data); while Cie Pos 1) g temp= t+emp> next} +e} IF newnode > prev = “temps newnede> next= termp> y next 3 -temp+9 hext > prev= newnede} +emp> next= newnede}, t i CE==10) Beletion From Boubly Circular Linked list Delete ror Beginning- struct node Lint data; struct node xnexts struct node x prev 3 3% head, xtalls Void clel frombeg() LL struct node temes temp=head; if Chead==0) Lprint-e Alistis emphy so else ff (head next==head) L heacd= +tath=03 free Cemps iF else |}2 head= head Snext3 heads prev stalls tails next= head; Ree Ctemp)3 3 + Delete from end- struck node btdsts} Stuck nodes Nat} Struct rede*= Greve as ——~ t Tatts pext= head: [| heads preve 55 E ree Gems); _| bya Delete ftom Pasition— | stuctnede fointdss: | Struct Redes noxty | stuctnde S prey $hesds ¥4535 ki } it if i i aah AVL \ | print (Enter | Pos lelse tf (Po. L. ghee nl Yetemp3 Int Foss t= 495 : oe ernp= head scan ( “od % & Pos) t= getlerghO3 [if (Pos <4 Ni Pos >) oti wali Pos” )} $ =). L_ delfrombeg O33 & price (* e\se IE while( ie Pos) fatemp. = temp next} ery + temp> PYev>_pext= temp rnexts Xemp> next > prev= temps Reus 3 if (+emp Snexr==head) L tatl= temps prev; free Cterop) e\se £ Gee Ctemp);

You might also like