Data Structure And Algorithm, Study notes of Data Structures and Algorithms

Data Structure And Algorithm Hand Written Notes

Typology: Study notes

2025/2026

Available from 06/04/2026

apurba-jana
apurba-jana 🇮🇳

5 documents

1 / 32

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20

Partial preview of the text

Download Data Structure And Algorithm and more Study notes Data Structures and Algorithms in PDF only on Docsity!

MUNN LED bU OSS dd ddd ddd ddddd dll Ww Data : Anything +0 aive \nformarion j< There are malnty two types of dotq Structure. Caled data.. DATA STRUCTURE Ext Student Name , Student Roll ato. Structure :| fReprecentarion of dare is PRIMITIVE Non- Primitive | DATA STRUCTURE] . ; DATA STRUCTURE _ Cosied Stvuurure. ~ Ext Graph , Arrays, List. Ifimregee eH Dora Strutture * | Teisar oc DATA STRUCTURE DATA STRYCTYRE] » Dora Struuure = Dara + Structure | [Caaracter | - Dofa Struuure 15 a Woy fo S Thr process OF Adding 2). PoP Operarton, QG new element to the {0p of Convert the Forlouding Infly to @yeblx and postAlx for (A+B) * C/D+E"F/q Prefix > (A+8) ® C/D + E" F/G + AB * C/p + E" F/G Postfix > CA+B8) x ¢/D + E7F/G (AB+) & c/o + €F/4 Let AB t=, Rik ¢/D + ET F/G patel SE ALO Qi * C/D FEED/ CG Rik C/D t E*F/G eae he R,* c[p+ AEF/G Ri* C/D t Ro / G ME Neer Ry € €0])+ Ra] G R,*K YD + Ro 1G Ler CD/ =Rz RR, K 1D+R/G RK Ret RilG Letra (cD = Re Rs ® Re +(Ra GI) Ri *¥ Re + ho/Q R, * Ro +/RoG _let 5 {RG =u Ri *K @2 + Ru x 2, Rez + Ry ter # KR, Ra = Rs, Now enfrey Pr Value of Rs, Ka, Re , As: R, Rs Ry t Ri Kg XRy + AB t CD Px Re Oy AB +CD/ « EEAG I+ od Enrer tne Valve of 2 N + KX R,Rz{RoG 7 FABICO/AEFG Li ALIKEDIAL shu Rr, (er,R, Po srFix ex Pression . NGUUVVTTTTTTT fia | ES] Ex > Convert (A+B XC) Into prefix and posttie— Lid aaa ex Pressfon using robwar form | | C : : + +0 Convert in Prefix Folow!ng operation se (x CB | Proaram 6 C% CBX c a C+ cBxKA I). Keverse the input string A ct, ere 2). FerPorm today mathod and Find postfix Expression - : | 3). Reverse tnis postfix Expresslon ctring to find the Prefix. : Ex:- At RKC fixst 40 add branches So +na postfix Expression CBXAT: Now Yeverse tris Expression FO ee the prefix $0 PEFIX 15 +A BC eer He Convert post etx 3 Dive perform pabulay (A+ RC) Pm GAT BC) Reverse string | [Symbol Seanned | | Post Ptx Expresston | (c¥*k+A) = C A n ( A Priority 7 ve De N 3 highest * (£% ARC #1) 2 highest ) * ee ‘bro Perty. PostAlx Expresslon = ABC KX+ . 1%, AIMMISED IAL NWUVUUUODULENUEI IIIT III ddd ILL 2) [Te _duete an element from rn Quese] QDELETE ( Queuelmaxsize] ‘tem ) t) fe insert an Clement In Q Queue ° | | Aloo : 6 QINSERT Laveve Lmoxsize), eer Srepi: Tnittatizatton cet Front = -] set Rear = —! Srep2: Repeat Steps 3 to S untl) Step 1: Kepear strep 2 to 4 unt) fronr > =O | Step 2% Sur trem = Queue LFront) © Steps: JF front== Kear Rear < Maxsize -)_ Set front = -]) Step 3: ead item Set Reay =-) Strep Se Front et ee, eA f else Bante front = front +) Reay =O ARGS Step u: Fring, alo. Duered ts rem Srep S$: Frint “Queue is Empry or UnderyFlow . © Rear = Rear t| Sreps : Set QUEVE CRogy] = ftem Srepe: Fant . Queue 1S OveyFlovd . SWWVUbbE LURE dddddddddddddl Jif 3). Each Hme 4a new elemenr is tnserted into tha queue the Rear Is Incyemented by one - | Rear = Kear +] 'u)s Each time an element is dajeted From the rene tra Value of Front is Incevemented by ane: | Fyont = Front +) | CIRCULAR Qvueve ae AL Cirewar queue fs one In wWeh rhe IncerHon OF @ NeW element ts dont at tn very First jocatton of the queue TF the Lact location OF queue is Fall. Old Q (c) Tnsertran adement In clrwlar queue + Aigo 3 QINSERT Queve [maxsize Srep 19 1 (front = =(Kearti)7- max size ) rire queue Vs over Flow £ Exit: Else. pole the value 447 Of 2] 4 A Civcwar queue overcome Hw Problem of tinuHifzed spaw In Linay queues IMpleMenred tf ( front = =i) On§ Q1TAY<. Set Front =0 _ Kear = 0 Elce Poat =| Ceeay #1) 7> maxsize ) [Assign value] Quewe CRoay] = Value - Lend 1¢]. [Crrewar queue has Follousino LondiHon 3 | 1)- Fronk will always be Pointing to rhe First element 2)- LF Front = Rear thi queue cdfi) be empty. 2) (LINIKEDIA Wwe wT U eed ddd dd ddddddd dlls D el uke an Element In Clyewar WUC: Algo : QDevete (Queue Lmaxsize) [tem ) Dy € (Fyont = -1 byik queue underflod and Ext+ Else: tram = Queue [Front ] ¢ ( front => Rear ) et fyonr - -1 at Rear = - | tise: Front = ( €eront ri) 7: maxsize) Lend 3¢ item delefed- a) su item q Co) Yrem =10 Ud. trem ts deered (O is doered. Queve ( Data Structure) Deaere ofevarion On Gueue. ex [pee eo] ee 9£°1 90) 72) aC = Qe aruc Kumar CLINKED IA ), WWW LULL ob bddd ddd ddl Jl WY Vrem ls duued. © A Untksd Wst Is q Unear dara styudure, In Wnlth phe elements are not stored at tonriquous Mm eMOrY Pocatfon. G A Minted Yur Vs a dynamic dara structure | Tht No. oF nodes fn g ist Sc not Lixod and an grow and Shrink on demand. Fett) =2 UW) Trem is duered -]>=0 False | 20 fs duered- le Each Element fs cated @ pode WANth has [ | [ze ] Step 5: Yueue ts empry | +400 Parts. Fe2 R=2 1S Undeyflow. FF info part towth stores pre |Infarmatrton Case 3). | and foln kr Lond th point FO pre MAXP Llemenf. ? ae, © py) tg eae | | Pn |Pointer | Et | Ae 234 | | Eee z v 2): }rom = Y (2) | ss Node info Polnhr pem = 30 Bee 5) vs CS==— == true Ex*t- [Start su boo ro] |} fee] }—fae kX] Raz =4 ATUL KUMAR (AINN Info = Trem Step zi fF start = NOLL then fek ftart = Pry fee Pty — Next = Null Srep4t Initiqtize tha COunrer T and pointers Ser =o fer temp = Start BTULILOMAR CLUMNKEDIN), WWSEELEELLELEUDTIIIIIIII dd dIdIIII ISS SS Step S& Kepear steps 6 And 4 unr Le hoc Step S$ Ler temp = mp Naxt srpda*s “se f= [th SHRP RS Let Ptr N&xt=tomp 7 Net Sepa: Ie temp — Neat = Pty Detering node IN Vnked \ist Dereting a node _+fyom Unked List: has three Instances. 13 Deleting the first node of ths = 0 4 Uniad Lest. 2.9 Derering rho Last node of thy inked sr. 34 Yerring tre nade from Specified Posifion Of The DI niad