0% found this document useful (0 votes)
11 views

Data Structure Linked List Short Note

Exam oriented notes on linked list

Uploaded by

Nilesh Koli
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)
11 views

Data Structure Linked List Short Note

Exam oriented notes on linked list

Uploaded by

Nilesh Koli
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/ 22
°, Vigt — C_doubly linked list 3s ackype ofinked — Mist there enth node contains —c—datte—_ a 0. Ye 7 Ané_poinHng te _+me_next node qnd_—the [the ey operation tm pu Aven Trsertion = na At the beginning - J ~— : 3 Tnsert a nein hode hePore +ne head - {4 ; ‘S) next pointer the n VEouS 2 S$ tn the New node: n * \e cuxxent +i) next pointer +p +he mew node. Gnd the new pg cle! [previous pi inter e + teil — = en Date . Page No. tn _the middle - 5 rade het Lane mext cand prey point =ring nodes +o accommodate the net nod. e. fey OF the neig hbo 9. DeleHan from the beginning - JT J remove the head node by updating tne head. pointer td the next node and setting tne Men) head pre to_null- “from the end‘ remove the tail Node by_updating she tai) Pointer to tne pervious node Seling | tne new toils —nexb To nuit. From the middle - Lremoie a- Specific node by updahing tes Lethe nexk i OF + & 5 poindey OF tne — ore VIOUS “ned Lendl fhe prev Pointer Of _the next nace +o slei9 +h cusrent nade 8 | Tpaversal = -| Forusord traversal = Stark Fram, the _heacl_& move pepe) | the tri{ by Pollo wine paints Dato | Page No. Bacleward _-praversal - Ee 3 Stork Cran: tne toil cid moses noord ee 3 the head by FoMouwiing tne prev pointe - i ~~ Y Searching - = Search ~ for ca SpeciPic node by troversicy [either fotword From the heaol “77 Oe back Word prom tne! teri) Cormparing data in each node. Reversing - =e reverse a Di by Swapping tne tnext porch prey pointe’ (Oe colt iceaee Tia Pana 3 tine 4 up clating Astin ec fais oleh a: and teil ss E these operaton make DU mere Flexible iy y +han singly linked isk Since they —cliow_bidivechianal traversal. a) Ahal owe the dif Date Page No. _inleeds tis. 9 Give —O +he_—_}inkeg —— disadvanta nge each OF _ | jist ONer —ano+her+ ~ | Advantage E each +0 implement pes dees -|_ Simple Structure ~-| eFFicjent Cor sequential head +0 +he Seeds access Pram Hee athey“tinleed 11st ty pe-.— + 44only require one pointer _pex node. -| feicient memory \Sage 7 J Fast ingerahion / deletion at bead Simple implementa Han + ip ygadstantbeg ee =| Only allows —trawer-sal__in Gne_divectien 4 ine FRicienk Por “operahion thot nequire -access to presiious node: ~—| No mace —aNclom access. eS - ; se hap Ss insertion ‘ond deletion ok. the rif wat ce trePeicienk 410s thé! _wequive traversing thes @htive Lis ke Bee 1. Kequired: Por poihtey Slow. Search und —insercition fdelition at specific position ——2 1 Doibly tented trgh a! e = erst ip polotey te the pext nod€ cand co Pointey +n tne perwiOus nacl@ Fak Ad antag e< van eFFicient Por | Operatan Needing “cuccess TO_both -periviouS' 9) next node, - = fasty inseraHon & deletion at oth ends ‘ sAeusy Implementution iOF stacle & e \ Di aclvantage = = mor toothy oi FJ i po move _Compiex +o Tenplemen} y pnanage Comple tenple mentation - 5 i eireuler inland: Ieee ft aanie ae the last node potoke_| Sea Advantage te allows cixculay timyersal + looping bate ty the Stert = = USePul for civuulay queue 4 ound Cabin, Scheduling + Can Stat +raversal From any ede “| eFEicient use Of memory. * Fost pnsertion. /delehon at canyy positho N Fi ieceloy huFFers + Disddantage La. it _enltr iad tig Ne vel Comiple xt olemienbetine = Leet in eS C+ -| picle of -InFinite loops te Mot maneged_| care Fully ste lo explicit end. Comp peating travers Logic st more Complex im. | [Date] | Page No. | Wa : na ot 4 Coultiply linked lisp st eo at ee. > each fede ha roultiple Pointer. a | to onbthey mades i rd lantbag € SEetcienk search gnd traversal 3h E Multiple direcHan é uOSerul « for teaple menting Complex Ee date Structuve Diseact lon tage = High enembry Fequtvement : ———Gamplex —teplens mentation _¢ ‘mainbenane < | Insertion ope “Ensertian + at create Jttiuxe. the_desived positin adjust Actordingly [oa] Page No. ae Deletion = f ye eee eee nning ae cnet ine he lick js pb, «Noting to delete 1 cn has One node 1 Set jt. ro * nui g — iF more than one node» Find the lust node, ciclfugtt. iby nexbh polotty ro dhe Setond node? & Ser the head tn +he Second nore. i 2. Prom “end = traverse” “tp Find the Second= te-lask node” & Set i+5 Next! poinde) to fhe hedd. ' : FF oO SpeciFic position traverse | Fe_the nocle pberove the ctkarget hode a Beyust pointer fo Skip the dénget — Node 4. Tustiey ow e EAE based OP dynamic a sts a\locaion and ligt tne APP os aoe of linked list pypannic Mem 2 inked yish_1S:0 duke SrruchrKe —— atiocation- Tusieicatian = us i gen dalnseheen he “(nodes contaiA poelement 4 namically AS— a linked |ish— where each elernent— a_eFerante —+n-the EX memory —1g_atlocated- oy) needed: during buntime= ins tig oncdlee inked lists ermmoxy — allocation -____— On dy pari mM. o Knked 25h %6ia dota _etruchure Huaves is based on “dynamic memory allocation hecause = ood = memory 16 allocated dynamically pee each phde inode are ot created! &. deletedi? needed —_ Wolte Memory allocation $s not Fixed & i+ change _duyviag —atinoie.— i er i HE Dy namic eiemhosyo: boca iow: - i E Vince dh” Mighe beend |p 499 i TAL‘ linked yigh'’ Maeroomy its. “CLO Cated dymamicaiig using teplotabeye il i: ib ao i each node 35 allocated Mmémory + ¢ P “Acl_the memory is released “iohen rhe ode is delet dest 4 E aS sopra provide Sevaral bent : EPFictent . Memory ag.e: ~ CULO cated pean For she needed - ‘ “Memary i nade axe Plexi bite 7 = linked lists, Car G9 Fou poe Shrink dgnanat deainyattel ed aw es + dyna oar @) memory -cilaca ti : graphic = “[bnieecl lish Cans nn anage gr ently 7 1 _ mam ory CFE iC TB reunser_htsimy—Linked ls browser history dynamically : inked lists implement undo/redo Functiona _ebriciently vit + Undo lredo-Function-= | File Guster mnanagement = linked | e File ‘Systern metadata Can mm : dynamical ] | plekworl |_WotS~ Can manage net dy namicaly 1 { a Le + compilex_design — \enleed 14516 can i | Symbol *able and parse etree dd (Sea ea a Sh __s. | What js the Singly nk. Hohe [ees 1 eens ane EY tree j_ltnect! Mish: 45-aL “dais riche _ | uae ie ee oe element _ riaer Sarr aioe caro Fsitontoined a node. a chararkertstics = ea {1 $9 Mneay ordey Dynamic size - the ‘Size Can gro or i Shrink as Needed ALourin g Fok CEFicfen} memory eae Unidireotts nal ~ tiaWer they is_only Ssible Ar: One Page No. == Si talhat ts Singly -cireuldy Linked a ote on _algorithra to traverse” ———ope) 3 ol A Singly Circular linked Jisks 46g a 13 list where each node polot Next node in a circular fashion. —|Key Feacture — Cirtuloy Strue tye =the last node ‘TF 4+n€ next node (ae | Page No. move to tne _mext node Ig tne head Stmp- ea eT A At +e end - Add la} eration = + the beginning ~ Add anode befor the head. onodées diFtey the last 1 node et 1 7 ‘ 4 ¢ int ‘ e at i * a _given position Deletion = 1 i From the heginning ~ bemove the - “head node Eroci be enel - remove: the -last-node = First node mith Specieic Nalue » By positian — remove a node at given PO ition + | Seatch = - Find a ood boy Jolue ra Traversa) NISiE ecich mode: POL aes 2 : ae ee LE Counce UGH) Count he numberof Node Inthe is . : WwW vile_o short note on dy nami.G__skorage_ Management -* PLolin___how i+ 13. donesibie iiss i eee ate Set a Dyna mic_ Storage management refers ‘VO-ne process of etl ocating —decillo Cakingmemory during the I-EXeUIt ons OF a. Program dt eri Key Concept = | Dynamic __me mory cloratan = nemMoxry PS Vallocated a+ runtime Using Function in c4+y 2 the cl located memory can be of ciny Size Y__Can_gvote or ¢h rink OS _needed_ is ly pica ly munged— Ll aire a OF memory know —— heaqp. Bena : ao (cae Page No. Unlike Stack memory +heap memary require manual Maanage ment by the fee epeceaaa How _}p_ Dynamic. Srorage management __ ig déne 1 1. Allocahian 2 | em hegp. eadnage mnt ystem Finds cr Suitaple blo\er O-F ete & feturn o_poip kr: 2» Using Mmecoory ~ * m € bet: Lamesa al memory cl needed. t+ Can Store 3. Reallocatsan ~ TE Oo program need More ‘oy less memon thon iniHally allocated. it can : bse PuncHoh +o resize +he memory blocks « ed ——— : zs —— fant ia D Fe a Once the qitecated memory is no longer needed it show. be Yeleased — FI +o prevent Memory} leaks. Fimemory management tzchstqué | Garbage collecHon ~ i fe cyincig + | 4s bundled + Cutamatically through 4 qe ion + l if manual | ma nage ment — Tn tanguage Yijee CY CHE developey_ must manually manage Memory * £hiS provide greatey Control but increse §$\ the -risle oF: Cyyoy Era gwhentaton = S LOS memory “$$ -Atocatd Freed the heap Cun become leasing “tO Pn efFicleat — (ial Pago No. Fell ausiag poly nensinal : | Ialhat _is__heacley_Itnked list 9? use headey_jinked {fst 10 Staxe the pos ox8 - oxTy 3x24 4 Sol = pcx): 998 oxT 074 eae (STs si— ls 7] —> [eT 2} [afe) nat tet t -k headey linked List is a dakar steuctuye that Contain a Special node at the beggin beginning of the List Called _ag__heder hocle: Se LHe header node allows accesS +o cul) node inthe [ist & Store the number OF node which make easy +o obtain the Size OF the list + linked list 3¢ the dala struchre that stare element 3? Sequence: each ©lemenk in isk celled as node: | the Ficst node in linked lish fs | head cmd _tash node Caled tail. rr

You might also like