0% ont trouvé ce document utile (0 vote)
13 vues57 pages

DSA Notes

Le document traite des concepts fondamentaux de la programmation en C, y compris la gestion de la mémoire avec des fonctions comme malloc(), calloc() et realloc(). Il aborde également des structures de données telles que les tableaux et les listes chaînées, ainsi que des algorithmes de recherche et de tri, en expliquant la complexité temporelle et spatiale associée. Enfin, il souligne l'importance des types de données et des opérations sur ces structures dans le développement de logiciels.

Transféré par

Jayvardhan Thorat
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF ou lisez en ligne sur Scribd
0% ont trouvé ce document utile (0 vote)
13 vues57 pages

DSA Notes

Le document traite des concepts fondamentaux de la programmation en C, y compris la gestion de la mémoire avec des fonctions comme malloc(), calloc() et realloc(). Il aborde également des structures de données telles que les tableaux et les listes chaînées, ainsi que des algorithmes de recherche et de tri, en expliquant la complexité temporelle et spatiale associée. Enfin, il souligne l'importance des types de données et des opérations sur ces structures dans le développement de logiciels.

Transféré par

Jayvardhan Thorat
Copyright
© All Rights Reserved
Nous prenons très au sérieux les droits relatifs au contenu. Si vous pensez qu’il s’agit de votre contenu, signalez une atteinte au droit d’auteur ici.
Formats disponibles
Téléchargez aux formats PDF ou lisez en ligne sur Scribd
5 Sa Ne - Note: Pop'n a ple. NE simp 1 \ ae ne 7 to be corefall Pop'n 1 — sarple 1 + Ta ved in theoty bi fpr ce) ~ Sample ba in Ry we act sa pee frogyamning i ccs - Po ‘ 2) callocC) => contiquow, allocabion “All the davviphion same as malloc() ex cep : All the values at allocated memory ave initialize) to zorg. int “phy, pbr= Cnt") calloc Cn, sieaf nt); realloc C) > reallocation TE the dynamically allocated memory. is insuicient we con Change yy OF previoualy allocated memary using veallac ) fune. = plr= Cpl-lye*) llc Cpl new-sie aa wwe) 1 n*sizeot ¢ SURE cots oc cing 63 Used to brangter program contol to a predefined label. “Hs me is avoided since it cowed confinion for Fellow programmers aan ie puforable shen we neéd bs brook mut le | sing a single stalewent ab the came dime. a t — eq e F Cue're ine label \n"); — © = whut 0; ae “ws vil Est grind © 6 tan ©, shen ti gdo abel ag print O, Hen ®. Boao _tewute VEO — Anbels prinkt C°\bu've wt inside loop \n"?; goto end; pind C Hell’ ); pitt (Ab ed \n" ); ehurn 0} K Fait Comlpna dn chudure) : a User defined doba type The diff. ie eet es Ee eee col aaiapedent coe Asal en hin al ts ge dda E ane student 4 A ; he a a te : chav nome [22]; = i 3 J at 6 Ne we NE Unio. wher age is inbialized , name is cvryphed. “Twnit name is iniialred Yen ape is ovr % Time Complexity & bg 0 Constant time » 001) + Linear time: OM) gee defn: 0-8 O OCA) ig also OCn2) is also [Link]?) a i Tadytlty defn: ioe order of et “Analyze & wrike min, oF these. eels, eee pee POG PAR esas Maks pl astie Aol ais OG ag) = Bod sad 0408), 002"), oC!) ince ——— eng oee TemgE LE 6 fan mae cho constants 64 i Theta) aaah een, i } Sh. T rca te be Geo) 16 & only f doe one exists a eyem £0) [ LA i ee oe fr a tae dia — gH =O tet gems nt elt Of Me cab satisfied PY Col L nye “FCO is OCnt) AD iat iol n stig 22 at soo : oe Ais OCI) then it wall be OCn), On). OF De, SSO = cae fin) + nom - ~~ Fenty vy ~ — @: 4(n)= n+ let g¢n)=1 04 c. tent! 1 _ eal =i ye i Hed oes oo ENT She OeCL) 51 ig Theta —+ 0 kon Ln) j itf.. is, & a NIN o¢ Se F(t 02 tee eal, Ma. —— Zeeresing onder ot Common unk meg Js 4: “arr hs B47) _-sorted in inc. order ——L wee given a 0. Ae Nts the array, = ‘Algo t=) | Start from Let element AK ppg 3 Bill slement ic fund or Ha tk a dle ‘a (agin) £ Fin), ~£cgle) nz -6ger) i w Kr Fur) Gm 1< log MEN plogn ete Ne 22” aN Fill end oF orvay. ld time for one comporriso Se ers Fund Sepa sof Gnk tine). Tris will be mt for ony as Buk Gle= OL) Taek “ Wowd (ose Have te do all 0’ comparisans Ca is size oF ary) 2. Time: Ta= nk ce Wowk Oae= 0.) : Ayuage (oe = O fe ZalL gsi wcomee ) “ total ro. of posibiliiy 7 al possibi thet = net a \ een Algo 2~ Binary Search Buk (xe : ‘oc, Worst (oye: We Keep di siding «one. enbta for Vs element ize nok Saul fe pp eleront: found abn ph sal pussible ouk@mdl= K+ 2K+ 3K... + nk + is aaa Ay ses KLEE 10), = x cotent 20 n+) 2 Cnt) = kX i) = kn 2 em) Hani “Avg. le= O(n) a ay sine by 2 wil it is. nob Ae n=l6 ben 4 4: Tf n=e or PDA SIS1 23 Space Complexi ing an any one ‘n= = ol spe complexty — ae _ TE 0 Funchion calle eel ‘eurivlly “0 re py is Ocn)- i3x2! a Space complexity af 0 fr ok loll coal, eg. Al 4x8 beater > 2x It is 4 i= ay ul —r [3] —> a eww - airy ibtt hits 2 Saceomplexity OCH) ives Ol) % Time Complenity» Tricks + vaitiOnA 4 Drop Yhe non—dominant: dum inn 2) Drop the conatand dur i 3) Break the Code int Sanger. —— 4 ink i, | K-time-Coritant Link fum= 0; gi ——$______}| sj, not depedent are Ke time | 2 X= YH 5 4 u $$ _ fox Cakjeo,jenjie) 6) | aan elo E- poe { scar 2.0) aed oe patting pe a fovlint j=05 je; je) ms + ' ke; Jie => O(n) ate Cen es emehe L) eee vihine pun Gink 0). pends, one recursive ms below, unit ime to velurn a Yon Or, whew the prob. of ach int taming yond om is eunly dighude within, the the Yonge. Loni). 15 the 0 unin time ig Tn), wha i value of at ts , y Wen by Many (ose, Sinkfunclitn)4{ Tessa ink ¢= 03 shane © Sie adel + wA i <0) a sll pm~ dura 0; Kes Sc — JL], Bia = mn); =) L he alt Tonle $ SALE Vibe 00 WER ot Te To ata a ‘ 3. EONAR 2) Js nahin ee oe Gunite | ae 32 ea Tee Te ss [ot yok INS ie eee TA=¥6 woke. Ie fall. ane. 00N)2 Ck ig corutant.) HSPN wtaPd Nias RS wll aaah ~ meron Oi 0 (aN-K1 Ot) peewee ane ©) OCwt en wy. oer i lag grows shuly: - i — i ig aided su OWE Elog nD 0dN) 2} OCn+ wt) O(n) AS Mig algo ins Site, ee: it | ‘ eal Fall. code gums dhe valeg ofall he nods, in a balanced binary sanchy a Hho ists vunbime@ ahi | int sum n (note. ole). ft nt m aS if i =NDLL) oe . _ 0; V1 NV. ~veburn_sum (apd. lef8) + 2 node valve + sum (node right); eee ttn en do take isegh a be | ml Oe ibs stunbime is fe OO). es ime nd.) ae > i int_is Prime Cnt n) £ Si i fn==t) ikl Gor rulurn 0; meee 22 % w-l fovGnk i22; iti i=: r Samiti vi . ne ide al) wm o, J? a memory Layout . of C progyam ” sat isPrime Cink 4 for (int i= 25 i* 1410000; pine } K . if (n2-i +=0) \:.0(4) Apis — rebyin 0) + 06s L Raa i he ila va L j Dab aia i ‘Asvays and Absbradd Dake Type C07). | Aevays: Coniguows. blocks oo Maing Te only Soe on wage in_nenovy. + ADT: wlays oF clagsifyi oe ing a. minimal expuled inturface & some sot | gp poclen th 3 y wrt! Funrhonably _ Operafiond i “as > Minimal funcional: » ge elenunt cb ith postion 2) set, num). aD on yy) a 2 ) a Sr Weald 5 ib pverwettes | + 2D Stabic Arrays size con't be changed Araditional onnay q i 2 Sf Gh i tax) add (avr) = — om + gtk) set Ci, num) * Operations on Ayvays D TWaversal: Visitin ng every element of an ovvoy wee. ) )-Tasertions An element can be ingorted in OrrOY. at & specie) — position . { “31 Deletion : fl element: at: specified can ho deleted creating a voi} which can be Filled by shifting. all elemedds Lo the eft x Pe is IMP. Tf aver is nok IMP thon when “— the lui ; Pere. Stil be tae dure order is imp. then shift all elemands 4 wright e — Gae 2: TF odor ig NOT imp. then shift the element gf ek ot index ob Vath onsitions ie saat. en - ier ; the clement af specified index. ee lame ss Seonrehin Je done | droversi ay whl the. ’ 9 eel toed bs iglied aa on 2 ar seu ie tg a al sy es 8 Song: rong lemons f array in specified onder. —————— OPIN il eho ye memory, lototions.. ng 4 pene In linked Tice, elamards av se ot Satie Fban: apt memory locabors le i r soe yo a t oT of ona eT Tn cane of Linked. Lick, adding A removing élements without any cagacity exalts phaikeof biked ish rhumey'y. spate for ind for ony mode. plr is needed), Gelade al aa remery Traversal of ‘0 node = On) Tine Complexity x Tnsortion in Loked Lists => diets Head %: ; i 5 BES ES SEES nt 4 bs r 1 inning: LE \=\ prsnext=head; head =phy, CBee ue ary enbire array bo tind ue node or eel Edity 2 % SAL x Lintay 08 > Array, Linked list, Stock, Guene Non-linear S=> Gemphy Harh table , Tree “Algoritha & Peeude code ave 00h relevant: 40 any program, Language. In ques. where yon ave to wie Zhese viride las, , Steps which can be implementa in any language. i ~ Operations = )Inswtion —_ Ddeletion _ Sovting 4) Tnversal _5) Mersin 6) sexrrching J € Algovibhen Daign “Technique )\, Divide pi! Conquer + Dissolve the problem inko sub-proh lems, them A bhtn merge Hem —. D Coredy : etn Diasert in Sebween: is 1-] we have bow specify index. | eg At index 19 phr>next= a>nexd; I a> next = ph, T.¢.2 Oa) —Wamurt after. inert of ltr a nole whose prsition is f alveady specibied- I meee: ——— == —— nes — qo declare an emply list jak. dos . ad —> NULL ee te NULL Pep ilpestas Nein an umply L LL s gut it ull priser singly kinked lise anther eprientadion) Hend ar Node Sa THe Node iS SWE wed fo acus Me List btu no tabi. Tn oie oF emply Ll. vejuk do: CEE make eR TaRet Punk to keel! ote: Valet 2h in C ois only for Yink! ; ‘ler! 3 em i J ", - * “Data Structures — "i Tada mm ev? é etfivenbly = bused on raaurte ui Viggiid costs ean cae “oporabons. ‘on-dato sbructuva: a 1) Creabe the 0S. N lnakinn ake Paint Hein: in 0s 2) Taerk trends... arcana Sli — 3d Traverse seg" ae SG S ciiiias so aa Data + Ceroyp of items. —_— bala item 3 nit) of a value. | tem 4 single Cun a ; | item ie i. a = tan be vide inky e ee he se rm tg. Name way eau. a ecco Telephone no — nts 2 (onection of group items = Record a ae ee File ation ering example) xi 420. ora veinaames alsovcon have tab a 4 m ype struc tut { Cn) is the enbire shrucluve da whith pS asinbeO Sasa -% points: Be (Me), C2). is He varinble a! in toad struch ah hal ee ‘ bl (2). 0240, Amada > A250; LiLiaeahits Pesci X>p= &m,. : oo Pps a 1 1 we it: - ok: ink i= @NULL, chov_c=NULL —> Works! Gab deat we it > Hue He'O" will meard Pre nuilis wplaced by 0 “ ss ak ie fi indeqe sc M0: TL NO" an int. NUL leah Bg ina memory /memoty i ne Pst a at te malloc ‘Cotsen - — pape es cdaage tae ~malloced mumory i is lost ae “hort 15-00 no. way of. sein a x “& Segmeodabion Fault — eee ee _- Program accaasing an “illegal * mem. localn. th euth peeeut ‘is punished by the OS by derminating it. : ilers decd ih hie s8me_men, fiolations. Use ea ati >This code should 609. fault. 5 ideally at c= 16, buck this does not happen always. dngemate, i‘ (Jes idelines to avoid Seq Faulks bili -iniFalize pointers to NULL 4 = this won't avoid $@9-Faulls , but may lead do eortly detecions of a prblen 2) whi ING arrays, rnake sure dha array index is valid, ever vebin adds of local variable of a function. [Link] Lé& NORE comnpiley's warnings. =Complets Fen warn abb- potential dangling ferences, ype conversions ~—-which-have.o. plaka Sov sy ful. i i i i ideo) DSA lechue-@ f tts ; inphuk, computation 4. Frogyam has, 3 pas lef — output si OS [ E “nput: Brings dada fromm input! mS ints mom —— > at \ Output funds: Take dob ftom mend- men. C* : t 4 ae ae fi) an File “Shand our data ox sayuesce of bytes. »\ al = De Asan as _ . Za at gears + Computation haggent vhing ‘vonoble,!. aah Sa “Diff 1/0 envisctnedts =) (eraphical, wel Semoved phy After fee Cp)_=Tve flr‘p!&___._Nebwotk , Files. eb. omaind same ae ; Re ther), 2 ebe. i : ’ . 2 ing fox opan ©) Fut cal in-taskof-C.h ilyiey. peed < Rae | “Aaymplebic Nolabons ae “ Ldn - ue vps Up we Bout. (ogi ha Pay 4 i ‘omega — ah lowe fut (bi d big Weba > © shila 0 pb ypet wee lll ve a nr da t (rs gomaren a iat paper OM, “wh ante “30 Ser 04 Bt eN KX es Gq 6nt ees Og 3nt2e3n K — 04 3nt2€ 4N 4 30)t2 £ 40) ofse4 30)t2 & 4C2) ee, ent 2 came, from adding time fo individual stepe on a program. qt 2-20 Cn) ont 4n +2001) 10-9 00) ___ 10+ An Ge) ee ge lone hare £ cor ‘a cell 4=86fte= et, e lontehnt2 ¢ U.N Pests 4 7124215. eB >» OF 104299 Daz nz 4 > Of PEI OX LOS lomyunt2 £lnt .. S25 wz (0) = 12.(g00)) where _¢ & Me ove positive contunts St. i o£ c.g(m F(a)... NE Ne ip =e eg: fi)= gnt2 ot ene pei > 041€5 pet net) a ess o£ fun) £ 19 (0) n> 4 — meer . q cagter bound | Nee ad a ea ey foeanree4n ne 2 02 0232 ..nzt | Ppeerteecsacmady 8 Fea) = (Gem). if £0)= O Gon). he Hind = LG Cny) See A eg flo fon Sy ————) . Bnr2= O(n) ‘ 8 Lecture 8 Twn sits of functions ope, wad, write, Xscek, close, fent Rab etc. it) Fopen, fread, Funte, fscank, Fprintt, Fell, Fyetpos, Fsetpos, Faieg ee irs nes accels Ble wig open), ry u een wei of fy ee Some thine far Spon(). ooo ws a as —_ {Seer jor y fopon() categor eae Ti eaac) wut “Hie® ide byte-by-byte access to__i) ome Funes provide byle-by-\yie g ile. orne record by-recotd accel. ii we bode gl Wyle! i) onab mY_we'n saved trom ‘We! FE Fes sates Fae Ch EE SPE . due ate }, Fprink FL) a sig : ~~ int float. obbur data dype conversions NG fdy_void buf , a ae count); = urn, no. oF bytes actually wad. mainta ined by uresbbrary) 2 2D. acts ou open dd, pre default pos is ab beginning of i le, A write) perform work ot current typos. i ill advance $pos by no- oF by#es they work of vad() rekuens. 0 hen fpos ‘a beyond the laut byke in the file. i h presentation Ae beqers ave stomd in 2's complement arwacters ove slowed in. mappings he ASCEL of UTF-2 oq: SQ! is 97 1-€. O1OQ00! “publ. & Floals in LEE. notation. | eq: Th-we ve 7a plc dog td into eed in _ the_mem. of em omp eee |: 41:- 00000000 O00 Thon 000009000 _i J We ger this ii ¢ /Biq Endian is ao -byte Convert from binary to + Reading from a File #include int main ©) FLUE "FP; char ch; th fp: Fopen Cdata bt", “y"); while (2) £ ch= Fgete Cp); if Cch== EOF) 4 4 break; while (a= fgckcde py) \_ \. put char (A), OR), print C°/e" 5 ch); sen TE Felose (Fp); % ehwn 0; a {3 ioe te sl Tene Me tat Pt 005 chas ch (6); Et ——.fip=fepen dala we) oe es +e ke pt Spink Ep Sah de FcloseCsp), a 4. include ut main 4 BME SEP, “chav chy ye fopen (dala. dort, ‘ w') dina hs for (i20; Lel00 5. int). bb i penis sed. “F \n" "iy sind); sin gui 2 ane Aen eli ie a eer ek ontpt ‘plat png; : ree , E waith ling \'."), Bini ati ac stance whure 0, esr Cavsiage Return. in. C Cr) ale World! \w Ht) 3 we bsoipes l alist Sal tinadlhese ts tie eg: print CHello World \n \r Hi"); Prints Helle World & then a newline An). Then dittor g oF kame line Ciohich is We newline). Then Hi is wren | “hy no overwriting eceurs a4 AEits a Rewline | Owput > al World Nok Gartiage Return may nok: “work in Online Compiles due 4o limited console rendening behaviouy. Ditty lihimrnsty sea! . os * . Model in fopend ) oils FILE “fopen Const dor enone, ante der rade ee Male itn a GT Read {| ) “v" => open for 3 for [Link] file must exist yb" => open Fe-veading in binary mode. The file most exsh: as Coa “un! > ye by. nig Creates a new File CE not exiding alvad ‘ brancated ne eT S st s | existing one. dbiek — > open for wriking in binary. made. Same behaviour of art i 3) “or i pin. Be le dea isk ok wiles za h “ab” —> Append in binary mode wy yt 3 open fe bath reading . writing. Ble mut exists rbe or “v+b"—> Read & unite in binary mode. —>—ti— ey lexus File is not truncated . when we sovite, it open for rinding & writing. Creabe a new file or tem coted on existing File be length 2000. , “yb or wth" => Somme 05+", bub in ie mode “py ta" 0p fir reading. & appending Cot end) Fle is ered :$ doein't exist. Toe gor arb" —> Same oat", but in binary mone fgehe Crate “stream dj ; Eee Wie b ophy 4 OF on end-ot-file ov ovvor: Nie Ascii value ae IAC enggoptiad. ae chiara ADE rnnorten apie doers + Fyets Coker ‘shy, int fy PRE Senile - Reads a line upto ‘net chats frum the file stream inky the | stops ak newline (includes in buFfer iF space is availabe) “ey 7 4 -& oppends a null temninabor Reburns sr on sucess. “Nyy fy [ahen od of le occurs while no chars have been Wal, “2-er5, M ‘ picid aa ee R Fpubs Ceontt char *sbry FILE “stam) _weibes 0. null-terminaded string to. specified File stream Rady | ReariVe AO. on success, EOF on errox Nl, —t q Fread Guid “pb y Sizet siney size-t unt , FLLE “steam Reads “Yount! items each of size ‘size’ bytes fom te fle jn} y | buffer pr. Relurns no. of items succesfully wad. 8 7 Furite Gonat vid “ptr, cam LL Gul same a Frat) Writes —— = Fee “he eee oe ! Eieot CELE “iran Vacate Ml nd ah die’ Shee checks F end of Fle hos been reached for given bream. Returns ny if ENE 0 alerts tsa Mill eae 5 "ge f fer ror CFILE *stram) 2 eee a _ Checks iF an error occurred on the given strom. Geturng Nbn-zero ifn ; Levyoy hod occurred. AY 9) Fseck CE ILE *sbream, long offset, int ovtgin.) _ : | thoves tre File pointer toa specific lowa'n in a file Cor reading or wri) of Fsek: Number of bytes to move the pointer. _ovigin : Reference position like | = SEEK- SET = begining of file... ave offset or O I ~ SEEK— CUR cwvrent position... -ve ow +ve offset or 0 I — SEEK-END-—> end of file ss have to use sagative oF 4p comple - . 5) sorting A a ) Ab: sir i =) sont je “dna, cnt: char *formaby Sct Read for formutted_ text fom a. file vovma = Formal vorinblas do store the values ote reeds a strig- until it hits: act (ot SNe ot i nok dene. Counc ba ee ak dae Seat aia) ana ye ee use o biffer ver lou) x ee a ala Tena, [i ah tn the hen Ander is: a Bike ates | pne_ov mirt_dimensions. uth 2 [fg Oo tat fie A dient Loo) 5 Condy Cora), Clit Cut), aaa Sor 2) ett. Fund foal Ae eens iain Ren sige be Gj list): hana he dentin hoe st ib fe io. hems ave. walefined. = eit) ce Ba ase ah le : value iin a = (i in index) lum on ovray wilh jw i aa “bel ae A End Array : : zz vtec LES I IO a a 0) fre Ph i agi ol Bg a Petes ae | yeyles Rebs. zeae itty = a % ‘ 4 iv) Jul one | - sate | 2s ing Sy Ox2t 1x24 x2’ t 1x2” 4} bCh 0 [PaaS deals rab. ae t= ge ea ae feted ee ee rend while Cy > 0) ch =. if Cys 2 Fe -6) a ; ges es prod aaa . ieee pty ED hus bd cAoving all : x from 0 to an _ oils cane bye it. stu nde Jaode; ald Set AMferetial touche . — Aye Lg = cing. Avail. pb. hich pb pinks to ook wed nena Ceype of 6 Bt yin gan lao Daisy aah Aes WHS Ayiy SS Is MEW] LL, eohich contains a —— memory which is nok wie | Bis aint hoa aed —_ KAvailable List is aluays empty ae oi; ig Tnuestion of a new node : a Consider a Ailable Lich Avail =TLeihe obo | Head= null flow when ue ardor wank to invert, end pik eal Ash node of Available List- ee neo He | arcde-potnlstr THO Avil Hhon pinks 40 be neXt? «Ned otha nade points ds NuLL. TAC We ge (vil _ Heed} ne tdeos ext « = NULL. eo then initialize | in the bic Cook ens nod = nut s: set Lemp—>nech = newnnde. mpty then se1 —_— " step 1: Sip 2: ee as newntde—> next= ND Name: Naik Ameya Vaibhav - —_ | Division: 2 CBateh sb fate: 20-09-2025 Linked List Assgnmat UNOS No: 612405118 3) Tneertion inks the lisk pes do wut; declaring an empby Ligh Head => NULL Sek-new- Create a newno pL. Tuer Tribinlise Head phy Lu! node 4 ‘ int data; ~ struct aade™ next ‘ ylama sidan atad do with newnoderdata=6 2h ib ind ist by doing Peed = reves Hood —> Fee nites oi az (reste. ae a oe in pith neyande-—vdala=t. &-newinede-rne- AND. ark temp = end Ao Hemp> temp-vaest anil temp oe Head —> eT3-> Ti) +> met Step 4: Repent step 3 imines Bead (> D> snl : | a ai E | 3 wit hange newnode-» data= 4 =a : Crate a newnhiae i> ht ‘ ape step 3 with only hg sea ‘ Lo] «heals >No > Btw hep 6: ith newandeodabn=1* 10 =\0 (os repeated Zed dine) Ce newnede-> next = NULL: Repent dep 3, wih Mt d Gb Te E> bb ie net > Elon wake: Ahunys we unk) test A then repeat! unless you wank to do a do..-while operation [Link] with aeunade—rdata= 1°00 100 Cou 2 is npended fa im8). Now, we want ty insert this node after the node ankaining 1. Head di do temp=temp-raext ulil Lemp-data = *. — newnode-rnext = temp-rnext & bemp-ynext:= rewncde > > ee Teh A nue y peat Step & with these 2 changes =) d-nean Jes data =\"1000= 1000 Cos 1 is repeated for 4 4 bime). ar = tyotil. temp data= 100... = UT sfno] > Wooo Tb > ETA Tal sel} 8 b> NL io: 3 with oly cutge reunede—rdeln=B Te Toa) eed Eee EP PD ue 2 Si ha hs 2 =H in 2 inhi > = Lempert = [TT Tae Eh Ee Ley Sa i | - a v, “E, Le ce oc sink _pritk prio print prime prinh sop 4 = «hep 4: Free temp ee HEHEHE, ae a aa ei on »- pelle He smal hunbee 200. “ Repead algovitho sn ‘a! pat uit ony dhange “buat: Uni eripl a ead FT LEE, 1 ev Be Oreo a a Step 1 Set + Step 2: alata teh —— ‘Shop 3: Free temp. Head ir a GSS BLA iE EE Gr ni ‘es : i aa step ES Until kenp—viert= NULL wed prev= bemp i aid | _senp ep atck ee estat aR Step 4: Free temp ee : ial ELe T-TEST Se H beginning ee e=sdata= value ‘eeu 10 seb newnsde »data= vale TN ala ie loeb tmpbead ar S ——|B-tepeak step 4 while ae = | temp -> nexk t= yun ; 4 F i mn 5 net = newnede = 6) $1 =>. ext = head 5 hil ) exit. -> next }= head i , p= hempyred : cet newnede->nesk=head é = newnode , temp—ynext = if | Fivgk node felde Iu rode ) ejoal . i ile temp-onbet |= head Lemp-rned-) $- heed set temp = emp-rne__3)_sek_ pix > temp = temp= = ead exexk 5 bebe 4 B b temps, next = 7 nak= NLL. 1) Free temp. 8 1) exit + Doubly Li oked List a 1 doubly. LL isempby =) Pwo Head = LL edd bis, nl Yates tsa Nese i, aii 4 {wee : Pai vent a oll So Nv %\60 uo <—“[ioog 65 BEE egal NULL ; V0 Wo 1500 —-

Vous aimerez peut-être aussi