0% found this document useful (0 votes)
6 views18 pages

DS Module 1

The document discusses various types of data structures, including arrays, linked lists, stacks, queues, trees, and graphs. It explains the operations associated with these structures, such as insertion, deletion, and traversal, as well as their characteristics and applications. Additionally, it covers the concepts of data representation and the importance of data structure selection in programming.

Uploaded by

aradhyamanil9797
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)
6 views18 pages

DS Module 1

The document discusses various types of data structures, including arrays, linked lists, stacks, queues, trees, and graphs. It explains the operations associated with these structures, such as insertion, deletion, and traversal, as well as their characteristics and applications. Additionally, it covers the concepts of data representation and the importance of data structure selection in programming.

Uploaded by

aradhyamanil9797
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/ 18
Module - 4 Pata Data %& the bide erly ox fact that % Used to Calceilaor 6% haarfipulalioo poocess There are A types of dala 1 Nawesical data eg: tolegey , float 2. Alpha vurmerteal dala 2g: Gg Pala roay be Stingle ov a set of values Data Stouckire ar Aryltfing that Cao lore lala Can be Called os Tala Sroucterte chasacky ebe are data Stouctraes An} they ave , float , knew as phinfve data Slouckraes Pala Stouckne & a coay of ongariding dala % Such aA wag dink ce Can Peoleorn § opezalfons Thee ave , Sore Ceroplex ala Sfouckires eobfclh are Used to Sleve laege and, Connecled . dala. Somme exaraples are TSokeel Bet , ieee, Groaph, Slack, Queue- Classiffcatop of Tala aoe Nbo- reat Urea Tree Croaph Table asc [eked Hist hace Queue L =e Bukit 4g Uses Adi ved 27-1 ul Neo kineas hears ot — float cha Piles ! fons Uyntlich Sace Queue ba ve Lfneav Datastouckese A type of Ditka Stauctase, tohere data clements are Aaranged ready Such that elements 45 rectly Rnkedl -bo Pls pacers and hezt elements D Away. Stoves hermogencovs elengents al heerno7y lich are — Cenlfave0s tol.aolaol4e leratfon WH) bree tts Separate objects ave Slevedl Sequenkally Eve. i “Very Object Sloved Fm the dlatactouthme coTl rave the data and. a aelesence to next objec! S yes of [oked Lest Fraly Urked Ist Doubly UMpked Ufst- CPacatas Woke lest Dala LL PAinled [el >I] “Node ffi) Shack A “type of dalastouctme colere the Clements Sloved Fo dalastouetrre folloco tbe ule of Lifo Clash Ip Frost Cov) hy bs > ' a F 8M) Qucue ( 4 i 1 TT 8 tym of datastouctche heke elertents Fo be Stored follows the mule of FIFO (Bast i Frost Oot) scolouda pt < |lofelzolasl 5 Upp = Lasttib weotd Novo reas daladay clase A foong of — datastmiciene eohese the dats OG Gre! nok —Rreasly arranged [ Sequentfally oeanard - *) Tree Tree fe a dala clauctase that aepresent bierarchtea! au Conledns Root ard leat odes a : 41) Graph ee A dalastouckoe Confislfny of ottees anak oltes date. Veolices ase the nodes ancl Edges ave Wes thek lomect ang | vodes: In tbe © Qoaph i & @) © © 5 ' Opesalons % Datla Slouctets es data. elensent Y) Seaachfng = Easily Gare ang — Sot elements hes Fo Ascent 09 [desrenieg coded a) Sealing 3) loceolfon ~ lnccots nec dala elemenk % the dhle shucke A) Delelow = Delele the data elements Grom the dala ctoauclus 5) Updalon = Updata | porlace easing elements {oom dalasiacto Stacks : Stack % "a! Mear date stouctune A sace fs a Wk Of cleweols % eobfch ay Clemank wey be Weald ov deleled only at One end; Called Abe * lop of the Clack. Shack pRog pe. fs LIFO Cask by Kose Ove) Ta elewenk Abas ansested lak 6H Ake Gack “eotil be” delete) test foore Me Shack. i < wg had baie Cperalons, cusocfaled 6S Slarkn ae D Push * ® Pop Pus Hsh - Psh Opsaltn & umd Pop - Rep cesaltion’ & fo Gd neay elernents foto * che dock u Ned 40 delete Clemens Lona? Abe shack opal S| Pe] tr] >| 5 6 a depo [2 ie [2] 3 2 Pasht2) Pushes) Pusbea) Reet) eee REE ep, oo SIs Sls tepalS_|a [2b uae, 2 |e Taleo tepal2 to Pop? Pash ¢21) Popo Popo Pop cd Array Repoesenlatfing of — Ghacks: Element capadiy of a lack is Called the Sime of oe ceva. The nunmkey of Clements to be Added shoud ne exceed he maaan Size of the Goce. Slack OveoFlowo 4 a The % the Plualfor when the Shack becomes {ull and no more element — pached On to the ack, AL Ms pont clack top Gnifeales tbe. Wink locator of Ae dace Shack Undertow | Sack emply Mis % Ane Sualfon deo Ye slack Contain wo element. At His polok the top of Hee dlack % present ab the bottom of te Slack. ——_La2_ ES °° 4. Push C7 Ulen a element fade Jeaformed © by posh Te BB Ae 1? escol (9 A to a Slack, He ofeialicn ore Erwips vr re tesena2 * | } A } . - a ‘ally top= cee can Arte 6? elemen he, cle, Snciermenk ‘4 “A, we a i Foto 4 lacte, § We Can - ole q a dlace Unrfl the Shick # Nernenk, Ate ee s fan, kop >= Sie -4 PAnctude ce eae vord " BE EMT Ue, Sita pk Slaw 0” ecint tua, 0) fob 25 : ig a n-D a . Paott Ceslaek oatbd elam’, x else 4 PRolE Gres Ae data”); Sant Cad", £29, olde agai ot . bop. = op 4; ; iol Data Racked Sisto Ae, aU eh j Algomtins Step 4: Shep: lop>s, Siete hen eth,“ ( Bkep2 + Othensise 2 rar . B11 Real dala value ted ete 33: Black [ip Sepa. End P= r 2 2 Pope) Whey an | {i % Performed by foro ! lernent ig Anton Off Faom te hate, the Opsaty 2 Ea Fo aie Te [33 |? ey ; =P a To totale HI Weal ; ee TOP Pop ack. for ; verd Yop 07 t & Chop = =-1) PRof ("shack & Undeoflocs!); - else t . PALE C* Delete data ‘ed, slack Co ae it a Alggfiirn Step 1 : Clack Glep2 :'f top==-4 then wale: “Stack %& Lndesitxo BZ. OWrrcstse : a ot a 34 Pint deleted elereni” 32 dope hop-1: Skp4 : End. Applecattons of Skice > Sling bare ie Fbrackers > Use4 ” by Complers 40 ‘chee Ly balangog of Peeorsisf cS eee < CNaluate — GBAmoetic expressions. Nolokion Gy aBtlirnche — Guepression. Aww, AC , DKE 1G Kepaands A e i Aleeenk trobelRons My ANeleaic exprcssfon Can be aeppesened udeg 3 nem 7 9) bokx nolalen @) Prefix vetalfon- a) Rostfix nolafou- YD Infia_notattou A+B The aftimetic Opoator’ 5 “%> bier he Cfroands- WW PacGx nolakey + AB ars The aimee Cpeoator ts before, Fs -keo Oper MD Toth a Notaltou Ab+ ; ein -koo Opeaands The actiractte Opesatey B placed alka Ts Voix to Tosthe Convescfon- Inlta notatton” foltscas Opeadtos Precedence mule Operata Precedence ule Oetes of operatfons 1 Farenttyects 2. Exponenk 3. Mullipfcatros Dikefou 4. Addiifoo, Sulbbeactfon Method b Assure fulys parentiestard Version of Paltx expresstoo 2. Move all ~ Operaters. 2 Remove! ai) “Parenitrests: F . yr Db Ase -> A+ Saheb Bm ook es AB timo: 7 ASSO > > CAB) + Cem) = TX 4¥ = Rys => ABY case rf *B) 4c) AB ete lets ages e oe Reece >@4arf(c-a) . Aot/ea et py X=ABe = Cd~ = XY/ > AB4cd-/ x = >@+fe-4) _ 484 /cd- =D ABt=M cd-2N = M/N = NAN/ => ABted-/ — > Ax Bee = ABwte Ms Age = Mic smc ae Mau) Agree > AsBalo-*p | | = A+ (8/)-p “2,44 Be/ _ p. Brattle [> te = At+k-p => Ak4-p L = ABp “= L-pe Lo- => Arp ‘ PAKHD~ _y ABc]-+p- wht. | 7 @iw 1e-») ~5 Abt | ep_ Ae+ay | > M/N 2s mins =? AB+ Co-/ $48) ¥ C/p 4 E7r le ABt= FT ABI xe/D a BEG Erte . PT c/O4 eer fy => T¥e/o4 ely Tok . > Texbaa) stp Klafe ny = LIA ka = Lofaicqy = NAM NMP Lew © LPI KA => TeAD (ee fy, DABACHD (ERMA /y > At Carc4 ox Ed 4F =) A¥ Bc¥tDEx Th = By SAVTEKEE => ATH 4E4F see PLAKHE = Let gp sMePs MEE (eae = Letey => AT*ADEx4 Fy => Apex M= Let Inf +o Pocitfix Converston ust 7) lack ) C448) / C-c-a) fp Slack Resta. “ Ais ¢ A i C A 1 Gy A B + AB ) ne fo / 7 AB4 { “« AB+ iS 1C ABI d 7C- ABC > 1S ABa cd 4 ABAcA- AB4cA-/ Aet cd-y 2) a * Cb+ C44) % Shack Posto = ane wu x ae a S «C a b at Le iu ¥Ct = + nes abe a a Abe + ) *Ce abd Ee Abe+dy ae aba da y ahbct+day e | a) nes 4) "Troe Gers = th a Pay ' ~> Me prc/D-C4 Aare Aebac hace 4 4 As Me v7 7 Agexpls FAC Ad Alex Shack alc xadel lt Yoet hy A A AB AB ABC Ancy AneD Age 10/4 At s 0/46 ABe tof at Apcap/t Pea Athe ap/4 0-4 Agcap/4P aE bifia a a ab ab abe aoe 4 Awesd aber 44 abasde areas des doc ta deld Pont fi lp thoew font ; at ; 5 A x x 4 ( x a ; B x - 4 ats es : a ae y : pues ¢ ea a ABCHE : -¢ aa ABc+¥D é C Agc+¥ 4 oe ABC+# DG 7 ach ABC t¥ PO ‘ a4 ABc DAI a: ; a ge Seah Arc + Dintee Raw Nnk. G2 CBee Laoro Roly gerpreton Ae Fees Seem Povcadlne. ‘ ce elt te codec 1) Scan Abe Rokix enpresstor 5 ; fy % 3) IF aed Srbo) % lel parertcsis Pas : _ DIE Scammed Sawaal a opeoahd, push TE Onto the pshhine expression A) AE Seamed Symbol fe atgble Penedtais » PP ail toe Plems Gero “i, | Slack Gand, “plate TH A Postfix expretsin unk] we ae a Leb Prireatbesis oe a BJ AE Scared Sepobol %- tig Opeanly -terreve AY Hoe Chreat ‘From slace and law ner % postin enpressfon Wf an, only wf the precedene of Opeatsy oO” top of lack 45 dheaka than ov equal to the precedente, of the ~opeeniy . Onto the Shack Evaluation of — Yostfia. expressfon ) When an Oftian} % Sen, Pash en to the dlace. 2 Ulken an Oprantes %& en, Openlor %& appfied to the top tm nue, tbat are Popped tao Ye Slack Gre] Aesutt Posbed Coto He Shek. GP W2ar+4- is ny A436 g| 446-4 ee a, | ae iB [eh]e 123444. = ——_. => 23x54 74+4- * * Z ‘ a v L| Beene Lh 5x4220 20} 6420226 2-4 it 7 ef |i) 2BAGAFAI- HIT a aaa => “o34¥44- , + zs a 844-3 FF) asses | q| 9-42-94 2 : S 4 Snook + : Rong = Reay + Atlee the Riseatfor of. the Aad anotbet elerserks, ben onl woe Fast clerceot 4h ee ‘coant io ly Abe Peas end echt be Fncved eed (tea = eat 41) . fr e e 7 Pook end edi be Focremmnlecl rhs echen coe axe TrolPng the fast clement 4 [ie fobso Toran wR ° Deleon Whenever an elerrerk f deleted | reraned ora a Jueue ,the value of foonk % Aocterented, by 1, te pont = foonk 4 4 ghtes it ote t ve os uf 4k (pilates Cell 1 0, Oat aac of ar foo, pos i 30[40[50]| bo] do2, 2-5 ° aS Area Represeolalfon of Queue. N => Madrourn Size -of Quin, - Cases D Queue eroply Aron = © -| ¢ Roas = @51 ‘ D Queue ts Fa Pronk = 4 $ Rav 2 Noa AlgoForn fox Enquene 4 CReay =n) Bad front = 0) Hem _ > Patol CQueue & Fi) i \ ext te Else ME CReae=) and C frortef) theo t 2 as iy 5 Ut. Pronk = Reas 5 O Y Cottey 8 lRead = x e\a & Else 4D Rent = eas 4 4 or 8 [Rear] =x "End. F on 13 Alyestorg lot Drqueue- HC fot => 1) and (Rear = = -1) f 4 2 Pink = Aueme ts Erapy ? 3. Elseif ( feont = = Reat) 4 4oovk = Rear = ~4 5. Else is b Tonk > Front +4 — ar 4. End eee lL Cikeorar Queue Sen ae ‘the Opera! > Choculg Quine f& a Wneay cata skouckare eck ° are boxed on Fro Cut fo Tivsk Our) Pandple >Los poRon €% Connected back to the’ fest a pose? wlth the frneg of een elernen GE Abe las locaton. Yo rake & Gacle 1B >A CRacetas queue 5 One Sn done Gk the fink locaton of Whe quent ot the Queue 15 Lull dvle Can Sug Ahak @ Prcalar qene %$ Gy Ove cobfch the Sas Clement Cons use alter Be Dest element ie pe Dek >) Pacutar Queue Aree is a modulus Opecaks £0 Coottng. Inseation - Exqyuene : NAA Crquene CPt) F Chroot 2-41 @€ aeay > Front =0; ear 20: ; Q [real] = Plem : ci ty t o 8 Alm Clse TF (COveat4 4) % Max) = = front) PRit ("Queue Oveoftero! else Geass Creat 4) % May © C¥ear} = then Dequere % Coculay Queue 1. IE fot = 2-4 ea 20) POL Queue Undeoftow Bae chert. deren os a) 4 , Siok - Yea4 eg 74. Se ete bs Freok ~ (Chior + 4) stax T- Ged 4b 8 Stop Dottle Ended Quae C Deque.) > An exterior of quene : ; > Both Faserton ani deteifon Cpreations Can be node ab ( bol) ood Ge. fron Gnd Roay- : Front Roar Dare Rea a {feoar’ Rea fon. Nelfou , Pelehen toe all ens SfernTmels ec ne Unsedhiao Seo >Deque bas 4 Operaltons- 2) enqucuc—frook | loseot ay element at root RH) dequeue front | Delek an elemeyt at front Ft) enqueue reas —: Incol Ge element at ead 4) dequeue. Yeas sDelek an element at teas. C4 " ¥ Crqueve Aron ©3 3) (B3fnl22]., Crqueue eat (44) 32 n|zz[44] eauene. front (33) beayue ery - Bal n\22l44 denne frond (8% vl22l44 Aeayaeus, Near C44) (mean Evrquene front (oa) There are 2 Aypes of Deque - 4) fopur aestPeled deque CIRO) 4) Cubpat estate doque Coro) ee eat telebso « TOLL iS tecerhee Wsertion at teat end Oy , but deleon at bot end, 2 Oulpuk westoicled deaue D topak vestaicted deque Delelfon at front end ody , bet @nsertfon at both ends. Voseatien, = Celta | TI K We shar Feoe Reas PRRs Burne > Aneltes VaSatoo of Gueu. value Called PROF - > Each element (nox been aslqnd a a fon 01) ue. > Am elewere Can Ye Gnseoled. OF Aeleted at positon qe Q % pokey > te fom phat Oy elearsk Pilly uuse ob me, psf» died > We Can delete an element for Priokiky borne based on Hoe’ Clements phlostte- > Merwe ate Some valey > An elernt of Hips posites % processed before ane Clement of locos PSooktey- > 2 Clements edt Saroe pRofly are processed according to the Odes % cdc Arey one added to the Jueue . 'Tollows FITO sale. ° fa ca en ta tay PHOBHY mn O12 FF Paden

You might also like