0% found this document useful (0 votes)
255 views49 pages

Unit 1

data structures hand written notes

Uploaded by

raj
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)
255 views49 pages

Unit 1

data structures hand written notes

Uploaded by

raj
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/ 49
DEPARTMENT OF COMPUIER SCIENCE AND ENAINEERTNG, DATA STRUCTURES WITH G UNIT-L BASIC CONCEPTS PREPORED BY Venkatesh A. Bhandage M.Tech, (CE) Asst. Prof. Dept. of CSE TCE, GADAG venkatesh ing} ce @gmailcom 131072012 eee Ne ff 8 foveRVIEW.: S¥STEM LIFE CycLe wae BASES CONCEPTS 13/07/2012. a) usually large sale cornpader programs ave mea ted a Sysserms contain many complex inkrahng parts. These programr undergo sao aa proces talled rhe syyern Ui? cycle, We cartidey +his cycle % cant Ling 9 reyulemends, analysis design, codin ard werd | Requirements : ail large programmin projeds begi? witha set speuttrahbns Phat define the pupae f ithe prnjet There requirements describe the infoymahon), Hed we the programmers aye given Cinped) and the yesulls chat we muse prodeuce Cpadnut), Aralysis :In dis phase, we begin 10 break the provlerd| down ind manageable pees. There are M0 aApie aches fo analysis t Boffo. andl. Tep-bewo, Boren -up agmoash places an early emphasis on rhe cooing #ne- oints . Ance the programmer deep not have a MaHey Ilan for the projett, “he veralhing program Aequentty hap many leetely conneted, evror-widden segmenk, Bortomy analysis ts akin 4 cn smuehng @ building tam a genenc Blueprint That 3, we view all bus ldjings identi] Lady Puy Cruse Aave walle a of, plumbing heanng Top-down approach begins with dhe purpere - that rhe program cull fave and wep shit end predudf wclvide the program int manageable segment. This yechnique gener diagrams thatare ited fo design the Sypstean. Venkatesh A. Bhandage pro M.Tech, (C E) Asst. Prof. Dept. of CSE YCE, GADAG & 12> i) —- fel] Destin + Condmuation g analysts phage The dengner Venkatesh A, Bhandage Asst, Prot Dept. of OSE TCE, GADAG @) meaches the Fyszem tom the perspedsve ¢ both the i objets pee: prgranc ede and Pre operarons perbrmedl orishen. Tae Brst- perspective [eads 40 He - creahon g abswaee dada “ypes which the second regu Lives Hoe “specication @ algantbms anda consideraho galgaithn design Peale. Debnement- and &ANI 2 In +his phase we ate chere repreleniatians dy our daa objeths and wre afgart Lams for each o peration on Hern. verification : This phase con tit developing covrect - —nesS prvods Ar he pregar, FessQe4 the program aith avanety 2 inpat data and removing errors poINTERS AND DYNAMIC MEMORY ALLOCATION Pinkrs + peBoiton. : ¢ allows the prerammey as eerence the (eq Fun 9 ebjeus as wellag objects C+hab 19, the canents: p rhuse lacators ) temselves. Examples DP ix is - Seclaved as an 10He9e0, Lox vexors fo phe locahon that | har beer cer aside t corvain gt; bag is calledl pointer, oR | he basic dake apes in. & ale int, Alsat, char, olewlle land void. Minter is a special date Ype which is deny) red ton shere basic cata Apes. 50 punxer is calleol - dpsed dade ype The poittey fates He vallty for “Ob (5535 it the sive pire LAO 15 64K. Venkatesh A. Bhandage (M. Tech, (CE) Asst. Prot. Dept. of CSE TCE, GADAG @® > Potually for any MpeT in C Hert sa conepending dype pei to-T. The achial valde 7 a peinzy "ype 's an yess a memory, —s|Ire Avo impartant operators used with pointer es ave: oe § — The addiess operator + — The olewfremnang (or indirechen Jape —>| Example g piney : consider declarahon : fat 1 &Pis bere,‘ is an integer variable & ‘pi’is @ poinktr 7 an integer th we say A= Gis men, B; reas address ‘land assigns itar the walls ‘Pi. Te assign & valle to | "we can Say: | 72105 or xf =10; In both cases the integer "Yo" is stored as the values ‘' In the second case the ‘x’ in hont-g the poindr pi” cates it be devetorenced, by which wx mean rat inf rHad.9 fring 10 inky the poinjey 10°15 Shred iabo the lecaon poited at by He pointer’ pi! —shlemayy organrahonrs shown below: . memo variable address eee ° Fi scooo] 65934 i> 8534 HOB 10 opeal reresetees ———_Ganital vepremintion. 4 > bine pointer is julha na -ngabve in WE CAN pet sic has a special valde Yhakrt greats asca oul! pOnKO The we eeeerewers Mae OSes ee: M.Tech. (CB) Asst. Prof. Dept. of CSE TCE, GADAG te fuole : Leve. Memory addverces 0 fo 6SS3S are call pointer constants” we cannot change Hem. Ihe 16 laddietes assigned ov variables by the tylXm are call [pointer values. Ext fa variable 'j adders tg 65534. \Bvariable which holds acldlress a anothey Variable 8 - ‘alled a pointer variable. Syaep + Pi isa panty variable. fren addition, Subirath on, muthplicabon & division 6O~ poinkens é null pointer poi0ks te ne eelh oF ZaneHon. null pointy is verelentedl ap by the integer 8 The ¢ mac NULL is debned be rhis coosvant. gull porndey can be Used jn elaboral expressions , WC Paco) oo it CIA) Rinker declarahon: ype * ideniiher; Soa ak Ls wame given to ype can be any dala | ye Fras Siler eiat fe fuchas iat,Heed) de d idenbher HiIl Hal He ide toro bane Mera mirarade date type 200 p fat xa; /Lavis pelnkr to integer, = Lleat xb: 1/ B19 polokr to #loat |peceoong data. Hrough pointers enample: fat a, iat %P 2 //poinky variable p= has i Grikalize poingr vanable Venkatesh A. Bhandage M.Tech (CE) Asst. Prof, Dept. of CSE TCE, GADA @ pont yd", xP), 7) betess cede using ponder Variable) Eran ple code t a ik fas fe a mytL we. 4 jab aelo; logical memory repecentahon Pa=bas prntt("Zd ¥dlo"xfa,a); //outpuk : 10 \© operehons febrmed on pointy vanables (or poirders) \) |we can asign a poimer 2 a varteble ¢ Aye point a erp: fa L 1 i A=V63 int ¥facka: 2 is iat ¥ 05 p= fa: // Opying address & av ty’ p' in chiecHy we can perhrm anthmebe operators such as additory, subiathon, malapheapon § diviton ading PomlXTs Hin clude s¢dio-h7 fi — [sid maine) el Lise {id anid, b=20: afte] [22] ial tha =hea, epb=hb; int a= #Pet #Pbe ink Y= Ha-*hb- yt 2 = kPa & KPbS fink “fd trd= Alo" fa; kpb,x)} // l0+20=30 pintt rd = Fel = ANN" xPa, xefoy): /[ 0-2-0= ~lO pried acl =/hd 2 Pa. Hfb,2 95 (C10 #40 = POD wy ij d| We GN compaye Avo points . ex; faz ph. Z| | v b22 a > > — VOeOV > > s|Me value Foy NULL is defined in the header Ale "stdio-h'| Venkatesh 44. Dhandage M.Tech. (C E) Asst. Prof. Dept. of CSE TCE, GADAG 26 loa ror, Co), vue Pointe Debniban: g ute Pirgey is debred as a spect _pointa| value shal pois (o'\o (neuter) in the memar or that ier no oo y examples include s#dioh7 Lepye serrata) i iat ¥P=WULLE | Here, pointer varieble 'f' is a NULL poner, Zaskad g uring MULL we can also use "\'or 0" Prorchecbing ? Cp == NULL) PRaHtC P cbes not poink A> any meme, Saebe mune allscahon : Memo re pp be allsakel sy’ variables is decided oluvieg can lab , deve iti3 Freel ci fat ald]; Dynamic memony llnahion 2 Process atlecaliog memoly spate dung ext iuhon BME. Cx: Hokeol ling venous emo) aaragernent fenthars ave clitivred. belon) mallocc) furekon Used ¢o allocate vequittdl memory spare durng exetabor), Syrtan: data-dype x? 5 P= Cdak-type x) madloc( size): Whe’ P_> fointer variable ¢ ‘ype data-rype. deda_nufe > can be any batic cada type such as int Aloat- size —> Number g bytes to be allocated ~sfmdlsct) veuins addyese f the frit byte Cvoid dala supe 1999) Cadloc) functor > ==> @xample : iat +p: | P= (id E)malloc Co ¥5i>e9(w)) Venkatesh A. Bhandage M.Tech. (CE) Asst. Prof. Dept. of CSE TCE, GADAG DD. cllocated space ,/4 memory is suctessAully allocakd, jULL Is rouned memory allocaton Auls Aoiss & id is length 4 bys. itallocake3 a ~ \dtl G¥A=20 by pes 3 Memory, 7 J an aca Ge ‘ch value pf TTT ad AP} p= (iad womlec (nasir«9 Ga); alloccdes the required memory GE mit ezaufon ame and automaheally inlhalize meme ve bee s p_fpoinrr variable ve *P ag —aumber ¢ blocks © be riata-h allocakeol- ; p= (dad tpe x Jealloc (n.size): srpnunber gies 7 ein each block. Wo} ¢Tre allecasedl enernory is inthalited autdmabally (© 05 exemple: | pir =Cint +) calloc (5, 2iz00F Cint))s |. 12, Suan po byes ¢ memory Is allocakd as Allows 0016 too OlOA COR Oul®_ Ole 0120 ro 0100 |o'e'00|eoo!0 coo eioc1o|ojo\olo Pree —— 20 a are meal gama | Ee reallo%unction_ Crralloc ¢) J Changes oy alters the size g the allocated memo Reallbcator 13 done as shown be loc Cry ntax) 1224) Venkatesh A. Bhandage Prot. Dept. of CSE" Asst. Prot. Dept. TCE, GADAG ez) (Hi ndude 2544 lib by Pir— Pointer toa Hock phy aCdataagpex )veallocCper sie) | 2 previously allocated . |i Cpr == ULL) memory elihey eting £ pinttc'trsuttiaent memory |ar); |matloc¢) ar callocc), yeurn ; size — New Bihar the block. jPoinls t be soled oloout reclloc ¢ veallsc changes the sire f the block by eutnd 9 or ckleh “1g the allocakel memory at she & end 9 the bloc LT the exising allocated memory can be cnutnded , per valle will notbe changed . 3 Tt the enlsing allocaka memory cannot be entended |thic fanthon Allocaks a comeleely raw bbc and tapies the myers g epi Shng memory block into new memory block and then déleles the old memory block. ZL we make vallecahon Pr previects allocahars( hy 4) 0 Here, 3x4 219. Gyses are reallorakd sar ing Aom oo § remaining blocks are de-allocated as shown below : 006 ol€0 lo —OlOF ol —att6 120 Set [ e100 fis ey pert] yeallocated by : — yealloc ise eee Are Cpt) =) De-allocaes Cor hee) memory allecakd by arallec or calloc For the above memory locaben if. we og ply #0 af Polluos -s fre (ptr): PT-O} a> 3 3 Venkatesh A. Bhandage Asst. Prot, Dept. of CSB TCE, GADAG @ 0016. 0100 oloa olog > FA pry <= Fiee memory Blur ths satement.'per isa dangling iNKT Go, wuLL must be assigned po per’ as folloos Ptr= NULL | Rintors can be dangerous je follewing situahans we may ablarngt fo.aetess an area g mernor, shat Is oud ng gran p emma : 1 [ a priate "ed xe) -Y + Le priate "Pd" *Cp-)5 -@) Stakment-1 is attepalle.wheras Saket -2 15, refrng 1 the value in previoils locahon which doer nat Enis This nay cause program ¢o crash, The pinier may rot contain addyess 3 legiimak variable (memory locahon ) | ; «ide. P Sunk adds Euamples i C= Tavalid addyess 2 devehoencigg Pray cath the program , je may cle-veferente a ULL PonkY which cautes program t crash . 2 valid integer velue can be interpreted a5 a poingt whi-| -chis very SenouS eNO. This is becawe in ang Syd} lems,he Size g int clala wpe G sire a pointer is Same| hinkrs (an be dangerous 63> 4 = = 13.) <3 > TEUKGlESN 4, Bhandage M.Tech (CB) Asst. Prot. Dept. of CSE TCE, Gaoag Go) ALAORTTHM SPECIFICATION ; DAHON 5 An Algorithm is a Anite set insruthms, had, i# Fellowed ,attomplithes a parhlay task, all algoothins ease sabsYy the Allewing crferia. |Zngat = There are 2erd or more. guankbes thal are extwna Aly supplied Output + OL least-one guanhty 's produced Definiteness + Each inthudhon Is clearand unambiguoeis Zolkness + Tt we trate owt the insivuckons g an alge vithrn, Hhen oval Cases, zhe algorthm serminakes aber a bnife number @ eps. EHethveness » Fey) insauison mast be basic ene h tp be carved ou in pmnciple, Ay a person uring only penti UA exer we can describe an algadthm in eany way like ating natu val language like english , wing graphic repietentabenssuch as Aowcharts, inthe Heng. G language . Selechon_sovt- Suppose we mist dewice a program that sorts asekg nz) ~ inkg@ns ff simple seletion is VN by the Allon : "fom shore inegers that are currently petit fad the mallert and plate °t newt in the ‘sorte lisg * Design: The partal algorithm can be omtien asing d land english language as fhewn below we assume thal iNkgeS ave Sinyed inananay, a. such thal jth inkegor is stored 10 i!” pesthon, ee izn, \ Venkatesh 4, Bhandage M. Tech. (CE) Asst. Prof. Dept. of CSE TCE, GADAG q tor i= 0; 5405144) os Lined she posit g lealt Hero erm 11 str onwards Let it be “pes Swap 7M vem 1e,aCil wth aC ped] fun chon by sweagping 100 numbers void swapCiat *%, lat xY) { /x both parameters ave pointers to infs */ tat eenp= x1 fx declares mp a a0 iat and assigns do it the cm+mns g what -% “points 4/ KLE RY S [RS Annes LAAT poink to inh the loahon wher x points */ ryssemps 7k places the entends ¢ ramp io location pointed tp by y %/ laved! aSints “wing the Aunchon, suppose ‘a' and ‘bl ave dec To seuag rhely values one @utnild Says swap (ba, Rb); passing tp ‘wep’ the addvssesg'e° and bl ‘The macw version 7, Swap IS3 debe sumPoryit) CCE)= C17, CAD= (9), 20) ‘te Lunchoris cecle 6 easicy 40 teacl than that g the macro bat Yhe macro works with any dora type. Sorting Hechoigue : we Ari Bad the smallest-elemeret in the list and we exchange it with the Ari¢i4m. ebfein the second senallest in the Iist- and ewhange it with the setord element: and 50.07 .Prally,all element will be arranged 117 ascend -ng order. cveyy hime nerd least Herm is seleuled § enchanged, “hence the name is called Selechon so¥t. | | 4 Tech ICE Tech, Asst. Prof. Dept. of CSE. TCE, GADAG (>) fxample ; working 4 Selechor sit Can be explained sing Following elemens3 40 20 40 5 15 Quen toms Pfr pass | _Adser pris 2. Atty pass 3 per pass A T T 9 alQ\=45ql 5 "Ss Ts ali)=20 | 26 \ 1G | 15 pee aly) = 40}! 40 | 40 \ 20 , 2° acaje S 45 | | | of , 40 bears 16 I 20 | 40 | 45 ISmallest 1S Wort Smallest! peaehttee New urate | all elements i is 15-€ahq.\is 20. echo is 40,enthany Cae ‘-nge with | i wth + itwith yer i jen | em. — | ahdiem.siem. | G program to sevt ‘nl elements using sdecion sort algonthm Hindudezstdiohy fdebne swarcuzemp) Corp=x, 229 ,y=+emp) void selection-sore Cia 0, iat a1) / tat 0, 1, ACPO): int hf, pos.4emp3 ff ide (Len de . bye T=02i2N-U ith f "Ny dad the position g least 14 fom ith pesition — onwards +/ OS =F y byCja its fensdte) { jfatjJzalpes]) pes=se J SwapCacil, el pes], emp)» // Euchange ah iem | J] with least Hem, : | | 13'25) » Venkatesh A. Bhandage M.Tech (CE) Asst. Prot. Dept. of CSE TCE, GADAG GC. 2D void mainc ) iat, 7, al2-0)} rinv#C" Ener the number ¢ isms \e"); stantl"td! bnys prinkectenter the itoms to sort Jo"); YorCizorienslet) seant("fed" Baril): selethon-sort (an,a);, }/ sort n' elements 4 Itst-a. print#l "The sorted ems aye\")) for isojizny itt) { pinHte“nd\o",acid 5 5 J Binary Search Asume that we have 12) dashnef integers that ont al gorted and ti hea 2’ Talis Wet alo] Zalé -+ ~~ alnat), weenutt Agave out ran inkeger bey is ia thic bie, Mb ikis we should we#urn an indes, 1 such thabald=Key ib bag d cot prererdt,we should urn -1, Since the ETS reed we may Wie the Allowing enethed 79-arch foyshevalug . Ue ‘leo! ond ‘high vetpeuntaly cena he th andl ight endl g the lise @ be settee searchec] Fatally [oo=¢ bad Aigh=n-1: db middle = Clow thigh M2 be tremiddle position Wn the Lite Fe ie compare apmiddle]usith key, we ob#ain one g shite YerulHs; fey £ aLanjddle].— Zn this case ib bey 8 pretend, if eneedt pein the posibons beaten 6 and middle -|. therefore we ret high to middle. kay = Wea lenddle] — Jn this care we warn middle Venkatesh A. Bhandage Asst, Prot. Dept of CSE ae TCE, GADAG C4) key 70C middle]. — Zn this case jt by iS present, H- muse bel in the positions bauxen middlet| ancl A-|. So, we set low to middle+) . Th search number has act been fund and there are sell ink go check we reedleulde middle’ and cmbinue rhe search > Fallocsing eugerithm implements re searching swradegg algaithhn mnpains Ave tubiasks: C1) peerming 7 there aye any inkgers lL to chetk and (2) aemparin fy falmiddl . 4 Binary search glgesthon while (thera are move INKgEns (0 chee) £ ~ middle = C lett tright) /25 yoke: #C key 2 almiddle)) pow =lett yight =middle-! ; right eright ele if Chey == a£middle]) yeurn middle ; else le¢t = middletls —>| we can perbysn compaitons +hreagh funtion er mace as Low wis ye compare ( jab %, iat Y) E ecanpare % ancl y reha =| fir lese shan, é he equal 2 hr greater / ’ it Ctey) vdurn -l 5 else f#(¥==Y) return O- alse ydurn 1; s)he mac vereion 1% as Allows . Adefine comparneces) (CO) 2-12 (O0==Ca))2e+1) PTO Venkatesh 4, Bhandage M,Teeb, (CE) Asst. Prot. Dept. of CSE TCE, GADAG C1) Binay Search funchon Lang i and RAR sekmeny) tat bs (lak key int o£, into) tat bs Gat keyy iat aL Lid 9) f fat low, nigh, mid; a tat low, high, anid 5 lew=o: high=a-e lowso: High=n-le vhileclow eahigh ) While Clow2= high) § amd=Clowthigh) /2 § mide Clow+high) />_; #Ckey ==atmrid]) wekarn mid] Seite omPaRe Clty,aLerid]) eC Key - emid]} if |. igh = mid-ls a ae a eve / it key 2almid)¥/ foi a tre aaa low = mid +15 cake 62 1eUYO ae sls ase Ls right = oddleL;, j we 3 Mend 9° wie ju ond 3 while. rturn =L) j Mend § b-sanethecl . £1 binay Search prograssy > | Hiadlude 4stdio.ny IeTnelude inary Searh Aunchan here ye/ void maint ) { tat 0 »),0L26) jtan pes! antl "En tar the cum ber ¢ elements, \o"!): sat Ids 60); pink zater td ikmsjo" on); for (120 ie itp f geant ("td "Gatid); d ys priate "Caner the ira # be searched \o"! 6 Gackt te “biter )) M. Tech. (C E) Asst. Prot. Dept, of CSE ' TCE, GADAG (ie) [fo pontro g tiem and nT 15 the prthon (esl teeny) pes =b-sCikm,ain)s it-(posez-t) > Sams praltC" Zien aot foung \o'l) thse pont" Bem und at] petibon \P} ges) qi oS 5 A EL as 4 nample: [repo [Be [as[soleoplopee Repel Ky =O (oo 20; high=q compardson’, kay = = acd) mid = (ott) /> =H 16 20 => 50 jhis qves. nigh = mid-l 23 lowso! high = 3 key --al00 12 202520 TU, oid = (o4S)/r =| Orde een Fuctestfally Recursive Algenthan 9 Perarsion 180. anethed 9 Siving the problem where Ae solub 40. problem doperads on foltykor? to smaller inslantes 7 theca blem.fhus,a rearsive Ainchan is a funchon, thab calls itelh Huriag eaetabion @ rtearsve Aunchon) Hhot invotes ipary is said do have ole qayssoN. & Ainchon which contains a call ” anothey Eun inturn alls ansther Lupoioy7 and Soon ney eventually cally rhe Arit feachon is called tachieeh reerson. Base cases & aypial case where colesan ean be obtained eith Cun LING IeLAY HOD. Mor5 15 calto called base herminad condikon, euch reise fanuhon mest have a base case. ; €L: Za fatal fanchioo, ol 19.1 & isa bee ase. henenal rules for designing veeursive fentheng . oeermine the hase case. (@ Determine the general - case. ()enbmne rhe base case and general case Venkatesh A. Dnandage ™, aan Teck. (C E) Asst. Prof. Dept. of CSE ailoiboi2 a Dd, TCE, GADAG Binay Search Plgenthm using veeursion) C progres) Hincludecs#dioh7 jaf seach Cink Fey iab acc} tab low iat igh ) £0 lod 7 high) mid=C (oethigh) > H/ And position g- middle Hum if Chey ==aLmid]) reurn mid 5 // hase cave s feunedl . iP Coy Aalmidd yeuyn search Cley a lod mid-() \ - yaurn search C ky amide) high ); vold maine) va-o, Lalo] 1M, post inh C'Eaker the oumber g& aements \o"); gant’ rel OV, punt "Enyey ted is)o"): Ar Cicos tens IE { scant ("td Bacij); F ine "En Pe the 1M to be seasched yor): sont" Fd", Liter): Hepes 4a prate Blem ot Around \» [score greater thar high hey is aol prese #Clow » high) return -Ls by iim) 20 f int mid 4 yourn gac Fil 8cA FIKC = - swarCacil, atx) [ey ee compel acd) “fet CAR He Meysively UE Venkatesh A, Bhandage M.Tech, (CE) Asst. Prot. Dept. of CSE TCE, GADAG (a) Gorhe general case car be With) ass . 8 [ SWAPCACD,acjyl) detien FOIA) =) ea tsin) awa? (acil,alj1) —SHothe complee algoathen ts wnittinas tollows void FCchay a£y inti, int n) £ inh $4 char emp: #Ct==n) — prnt"/s\0" a) els a “wr je Uidecns grt) t SwarCaLil,ac jl) dmp ); Fito Swap alilabilp swear (ail acilsemp ): | 7 @ permulahon, all vecursively to.su j Soop aijatil & ett iki Yann get back sring. XE pogram do generate permutahons Ven Stiay ~ |dlincludez9di6.h7 Aincludez sringy-h? lededine swap Ca.Yntenp ) Clamp =x,1=Y,4 =¥mp.) /e Fasert above Zunchion bere e/ void mainl ) : f chay acid): een inltt "enter a Sing |")) fnitra W105: #8C sank 7S ale Permakition s + priott( " formudabong\o" > ABC ACB BAC BCR F(a,0, thn @-: COR CAB J Venkatesh A. Bhandage ech, (C E) Asst, Prot. Dept. of E84 TCE, GADAG @») A? Compabng fadorel 9 caumber using Learseg Hinelude2std{0-h> i iat fat Gal 0) : | Lage s ft (aaz0) Yeon Enjern yearn opfa(o-07 & 3 feta | Yen me 20 Fauortal 5 S=00 Ae 48 i 47) Sung nedural oubers, prnit (enter ow"); seante"/d bn); pin fil td =1d\0" 0 facto); tat FGab 2) f jd(nes-1) dun oF yeurn arFe(n-O > fun 9 qavay elernents Hoal- FC#loat a€3, tat 1) it i#(n==) yun of vduy 0 alder Cant): Eibenact! Senies CeniES pehoshan: Pibenacc numbers aye aserer g numbers such hak cath numbey is phe Sum G rhe previous nvd numbers eutept the Prise and send number. ie o, L123 Ss, 3, 13, frosreum_4p_Dis oth a Auonbe Hincdudezstdio-hy id FCiak 9) OTe VAS | DATA ABSTRACTION Venkatesh A, Bhandage M.Tech, (CE) Asst. Prof. Dept. of CSB TCE, G. ADAG 2) ({ #Ca==0) Warn OF ( iecnest) ree owdpat ruurn FCN-1) FEN-2)! Enver O : 6 void mainC) = akg cb(=% 4 prema tenir ovo): seamed "Bo pink'# bC td = tdl\o" o,6(W))s j a) To disslay_‘n! Phonace aumbens se maine) fuechan est Ub wid main) ) Lid 05 printel "Soler no"); scant 5 doy, make’ tel Abonacd neunbers are\e' 0): fr(izo: i2ns ith) { pintec"hbCAd)= nd \0"" 1, AbCL)) 5 j —>PHher phan basic oda bape s C.aUlaas # gwUp code lejethoy, Pramgle; drrays are the cellethons 9 bovis g thesame band dada type. En; ink Misty Ss >| Snuets are collections 9 eoments whore claka bypes need not be phesame Exemples * smut $ chat lastvame: nis isce smectuye ett jak shade Td thee BCS char ry 4 spade 3 Data dae s A da type Sa wllabell 2 objets anda sets opevabons Hat ato? those objeeds ; ext inbisadoda typo & objeds ave 8.414. ---9, Abel the operatinsindlade she avthmebe eperadors 4,-, x, /Lo%/> Ve => e s efor farce 3 here FancBMs creak a aevd instance the dengnata dype a)|Observens /Repotions +, these Aarehon © govvide mbrmason Venkatesh A. Bhandage Aust, Prot, Dept. of O38 : TCE, GADAG (22) phswatt Data Type CAT) Dehni bod + An abstrul data dype Gpor.) is a.dada dype fs organized in such q wat (hal the spits on 4 He ober -ct5 and the specthcabon _the operations on He objeds ks seperadecl hom the yeneentahoo ? the objets avec rhe imp) bemernation ¢ fhe operations Exaenyle ; vo specicahan g 0 pevabons Ale trons snp lerreny thon g operabsens . Speci cahoe aniids ¢ the bagel ot Fart 0) the ope ¢ HB argumends. Tneve thou alto bea descapbon 3 whal the ¢anchon does , bat withook a ealing bintrnal roprmabar er implementason Deed funchars are classitiee| a5 Plows + Temaprmers ¢ There funchms also crtade a7 Infante ¢ the de rignakee fige, generally by wsing me OF move other Iban labout-an iastance 2 He type, but-rhey clo not be limsanle BR exaengle + L pestsattckda Typ6l apare blob) aor eats . ining ponies Se indig ab-the oaavientisn icHepy (LUT-MAY an the ompudor- sere y €Alekurallunber sT RUE, FALSE €keleap ereepae hand == are the wna ger ogeration s Venkatesh A, Bhandage M, Teed. (CE) errr woe (2 3). ‘e aatural dum bes aoe jive © Berke fe2erp(a) 112 EC) return FRE ee reeurn TRVE Boolean Equal (1%) na t#ssy) reurn TRE else redum FALSE payolaumber Successor (2) 11-= 8 (azar tMpy) 2000 1 prorelatucrbes Ad (45) + = ih(Cr9a)e canta) ram wty 2 Us ZWLM \pectarallaarber sebnasl- (49) *2* ay) ce eve tum a-Y end Naural bay . sl he ant dehnidion begins with the nanve ¢ the AOT, ere are fwo mah? eepons in dehpipons *he objedS y (pe Fao02s. Dre ojeU aie. devine insenmns ¢ the inte fuses sorabe 0 explicit wiyernte do phair veprctentahen >| mundo ‘Wadaralalurobar zerc) hay n0 arwurenb& ~" | redlenny she naturel aura 2-70 Ine fantBor — Successor CL) weuint he nent aatarel cumbor in equence. symbols Tapa’ should be read ag “isdeFinedas” aole ¢ A \what ts palo Absivalison g Absrachon is the process by whieh speeshieabenes 4 both data ancl enevahns perbormed onthe clataan clehned Coherens epierenal dadg and implemenialen funhns aye hidden fom phe. pregrammer.2re operalians pertomoedl oy date are noymally por rmed usingone or ene Suebang \-> ith vespett 40 ele ¢he applicahan program below; Specified data; “Hello” is a sting § fecitied funeboO + prini#C) displays rhe message onscreen . she pegram igs res > 4 > We Navmadly judge perdrmance 2 program bared on hide Venkatesh A. Bhandage . Tech, (CE) Asst. Prot. Dept. of CSE TCE, GADAG o3ozbon. (4) —> With resged to Library pegram : pole vepreseniahor s The ssing "dello “may be represen fer asan array 9 chavaers ev aS a linked he, bat, we do not| knoe). KE, representation demils are hidden fem us. fanglemenbag Poort Wve tnocs how fo ase the pratt) Func Aon. bub we do nop brow how she Ainchon pant4ec) if whit Len 12 impementabon débils are hikes for U8, Appltahon Pregram Gray f seu ot client program — Cubmry fle) pena lee paniec Hello") ain eee t Pedoimance Analysts _ Lak wage ofpnmary econday memory aswel! atthe — cxaatd A ' pes : ye Verbymance evaluator ZX PORTE dhe vbng x > furdymante analysis Cmachine independent) LS Perhrmance measaremend- (machine chepenident) (orformance andysis % 7he prowss g.euimaha pme§ spate consturmed| by the prograny shad Is inde eFdent 2 the machine i called ferPrmance analysis . efter 2. eye Car algosthrry ) depends o> 2 aurYs i) Space ¢ deny (2) Time etfaeny | & “pb gmemoy replied do run 22 | vorable Space Pequnerment Dre spate required hy variables Venkatesh A. Bhanaage M.Tech. (C E) Asst. Prof. Dept. of CSE ex) ICE, GADAG Spate comple Definition > de sprce they 9 an algenthen Ice ame | 2 pregram emplerely 3 tha’ -ertly. he ste ropiiement Jaa SCP) Is st bys Ze profiam Pdereted Yy SCe) = c+ S50 1 variable sce rapiternert Fred Spat requirement. thal-do net Fined Sate vequitemned 3 The space vequerements depend on the nuarbur i ine p preprurs inppeb dh oxclpeds re confidered .Gmgmends 9 fail space reyshieMents aie : |p frogeasn space C Space for smring the machine longuagg a 00) Lopala Space (Spare Hobe Hants, variables, syucares ete) | bo Sack spate (Space Ar pramelers, local variables ete) 1. Bored Seace repilement is qavanas ! C= Prograey Space + cada Space + sack Space . | whore 8190 depends on dhe jarnewlay iagante s rhe prove lave considered .2¢ includes an addihonal sjate refine when Q Foncaon uses yeursion. fre sence repAliement “Ss 2-2 prosrary ‘Pion a pareular intiance T derored bY SpC2)1s qven by 4 G2) = Prograsn Hace +-Dade Hace + Seb sone j Used dud ng wlursion PARR opspe + Phe jonah 1S 7 array CNHIAN "7 ‘aambers, then'n Enaemgle ‘is ihe in trance charauern sc Owe we Gp(n) 29 place SpCE Venkatesh A. Bhandage Asst. Prot. Dept. CSE ‘ei Fa TCE, GaDAG Ge vate s call be wally nesfectec| agwe will be concerned eply with vaniable space PUM So above relabor be scp) =SpCr) Examgle: Rvorenine Fate ceanglex yg felovo eegrenan 5 Hoat emote (float & float ¢, lect xy) f yuy~n pet #¥ loos | SA; Kebye en tro/eormes do the Fanchop reHiin adchess fe whole Size 1s A bYies Icpathed and the stack So,the shveol sale Save repo tement 5 prograar iS + foram crores, Sne in byfes, Pleat P 8 Hloat + 3 Hloak ¥ 3 local variables o darn address + ' Pick: 28 byper Vere, ivrespetve. % bor 5 ames rhe above im fs candied. He Pred space a orl same and. ce an be negleued ty nefecting A2edl space reguittmer, eve have, a Searqate CP) =Sp Ge) 0) Gince, Space docs donot cependl 9 any ingance 7! Sp (P=0 , P527| Time Compleat Venkatesh A. Bhandage Mw, |. Tech. (C E) 4 SE GADAG o4}ogbo lo 22) Anco veuses, yetarg or CH S-nat Fed space sirerveptvernent . Fastnd 14 Wa variable space requltement emapatecl a3, (Van tHers Sine tr by tek oak at] or tloak +a] 4A in- © 4 | ‘ | toon ales | Here, 12 pyses g spate an the stack ave vegpirecl for one reAy ~ysive cal: BL array 998 Is MAX-STZE poral sta0k space > 1D + MOYX-STZE 12, MBx-S52E 15 WDD oteel Sac Space [2% 03 = |2000 bytes. Wole : Os gerabove demanstratioS) NCUHVe prograrns Tiawe enone orhrends when canpared do the iemAve mee Hence yeransve progress are WY Aloo canparecLis iterabyg gm whyle AB rime efhcienty 5 Time eee or she Time, TCP) saben by fa Pron Pris rhe, swan § itd omnpile BMe and Hs run * (cr exeeuhoo sme) The ome efideny gan algerithin t— The omeund§ connie dime repuited. 49 UN fhe tt Wears Sareea ay eget nies vp wus i& how many dimes q program sdep 1s Ceheted| ay fregram Supt A prograrn seep is asyntoeally or semal anes omeaningtal program Seynent where enettuion hme #8 in penclerd 9 the inssante charaikewsies, he hmenta) by one progres Exp ray be same or different hom ano- ther progam Sep. L rol Venkatesh A, Bhandage M.Tech, (CB) Asst. Prot. Dept. of CSE TCE, GADAG ae(Pogam : Hea sum CAloat of, ia 0) Plo sum 3 id 1b Gm=ro,; * BrCicovienvith) supn = sumtbalid’ (GD) 4 Yeurn fuen ) => declarchen 28 aparameder TS imierpiesed a7 Pins (Coveis 4 bytes) Pre Hotel pee Br! requirements are; Yorammeors lene in bytes a [ Float a. A ie a A Zocal_varables a Float AU 8 iaki 4 Petuin Bedyes.< 4 ve Total = L 24 Here, irespecve ¢ number 9 ames the above Sere (ode she Ae baie vemains same b ibe oat ; ". Seusy CPD = Rance) as Sieve, sgate does nat depend. an. any Fesiane '9!: Sun (I= Gyr) 30° ay Space cmplenity 5 a wearsve Ojrany, Hoot sun CHeat at} int 0) f #Cn2e2-1) wun 0; védurn ali) 45am (@,a-1) 5 =| a at Venkatesh A. Bhandage M.Tech, (C E) ‘Asst, Prot. Dept. of CSE TCE, GADAG (29) Exacngl < Hakrnent "sem =o!" wil) fate le3S ime com red paakement * pr=brtyr /t005" mR Me number S-program sips carve D Sep count-can be ebtei ned UNS Steanang mihed (2) Zabular methec) , Gunting Methecl § ise a afobal variable ‘coud ‘aii th intttal vlog po aid insert astakonent- shat iecjerrent ‘count by 2 Areach eneetalole stakment Iniscan be done ashlloos ‘ 1 fer gape sakmend such y an expe SIOO ax assignee ert ounktt” eat Surn=0+ cough ths | 2S far tH syaeenent_ insert comb +4” behre rhe vb steakment . BS fanall Gongs casturtc nehos A intert coud 4120 the [mP. Onte condiban Als the compo! ny, fhe (oop hence insert ‘cunk++’ wmeciakly attr the lob P exampes Ar(t=03 12; hi { cunltt+s - -— F oudtts ebjain Seep count Ary the grograr thahadds ‘n|elements 9 the ony - | Sadornend cob 'car be heey Avot suntHlecd atid 0 eee Be 4 i b flak sm =02 lcoua-+5 [[frastgrmenl —— jab 3 UC \ ( t ' j=qjien si ' ae neta tay ‘ounttt: [Porshe ArlOP MY joud= sumesumtaca, lead 5 )/ Arasagomert — spuclt2 | : uabd45 ylasrexeuhon 2 fx yefury) scan 7 Count} 3 When ae 3 \ | ‘ Venkatesh A. Bhandage M. Tech. (C E) Asst. Prot. Dept. of CSE TCE, GADAG 30) c boy loop tS exceed OMe. Yount iS incremental hi3! ‘Lop sep cour) = 20 5 Gea cunt =3) sf Dial ound =204+% ve 50, Bnall pregranr skq cound-—204-% Ae) cbiain the 4p count dr rhe program +hat addy hh! ery ens @-the array wing recursion . float gp a ary,int 0)| Kou | Buy t cote) ven of Pp counteh *y reurg F@nvracels | jcounlt+ J al a S¥pount= 2- ~2|whe Toreninal condi oT yeathed, xf ae a se artonaucd 1%, S2ep ound =2 _sachame reewrviors3 called, af sseernend) § rain PAD) FaLn] are orewated - So, seg coun-=¥. foe qumbey game he rvearsion alledis +0 5}, zal aumber ¢ hares Sep coank-ts uplated : 20 HM, : AG | ebielin sep courd hoy she progam add wo matices.s nan who, nn —aumber 5 10.09 Tn —aumberg cations Void add (ich at LuA¥ S22), bLILMAY-S2ZE], bL id CCALMAK-SEZE] jit on, ind ; Pee sean’ 4) 4 for C js 0 i407 Std => D £ ccalbypl-ardcei\+oraeay Venkatesh A. Bhandage M.Tech. (C E) sett GaDAS (3) 3 fhe oun SeePeons that increments value § count 7 | can a. into above Gregan af blow void add Ciat QlICT Not E92 jet c£3CI,) j gree eit CLICT, lab 0 ja! 9 fr sor lems iH) F grtizosiensin4) “] { 8 cook 5 (fo __ We ' py (je jens) brcoenyte)) cound-+4 5 f i \ ( ! ( i \ j cent se alidl£ jl d LOGIT, count+ts Lota HE ae ( J unk +45 | “Total Tee cud = = 2mnpum+tl peamine spe siep count AY early sfaternerte Tals is Calledl cep /eaetuti Cie short sle) wadl as "step pey eaetation - spatenent" Cind cut the aumberg 6 N= mes each saterpent Is enetued 2 Anis t8 calleol Frepu he heqe non eneridal crement is 2erD | ge ial > |watbply te Gobroined i0 sep 1) and rhequerey (obisined i Hp do get foal sips dy each sadtnent. QR KH \fabulay noted 5 Fallowing procelaye wed ty Arcliny sey Verkateae\ a. Bhandate. isst. roe. Dept. by cse. x ad|aud she don aaa in 9493 Fagan 6S entire Feunghon) -

=3at n tral nee 3(n) = AN (T-0- 1-932) Venkatesh A. Bhandage M.Tech, (CE) Aset. Prot. Dept, of CSE TCE, Gaoag Ge) gne con farninl-do be sabshed 15 ) fin) 2 cx g9CR) for NZ Brio 2 to hy m2 06 10 Hn m29 fam above yelahony C= 4, g(r))=p and M=2, by dehinppens #00 = © Cgtny) AO #n=O0(r) LG Pg. Debnibon s Big-—D isa meagiye 3 the leat amends hme daten by the algnithey A complete ehercihan . let Hay) Be the| dbme Complemty @ an algen'thn fre Feanttan Hn) iS sal do be 619 omega § ln) which 3 denored yt fin) = D&G) ; thad-thoe ats a gesihve cnsant'clan non-newe ees sabstying Ae conspcink . ton)=c¥gtn) Ar all nZNo 6, fae dravo He graph Zr) and Cx9(n) vores 6, she eynh 9 Hn) aie re g gin) 4 sufficiently lov ue 9's she wi . é - 4) given duncho cgtn) lower bound . ie d(n)26g(n) fall n2N——> t No Venkatesh A. Bhandage M.Tech, (CE) Asst. Prof. Dept. of CSE TCE, GADAG t7h3 ole (3) (This nofahon gues the louxy bound ona Zanchon #(n) withio) aansant fats. ne (ewry bound on Hn) indicates that Funthon Ho) eit] contre atleast she speahedl ime oxy). AP let Hn) = loont, Engress Ln) usar big-omesg , IM His given thats #(n) = loon+s . fod glo): \erus empress. 9 (5) 19 terms 5 Aigher orcly Hmg. Hind ap Ghoon below + : gin) =#(n) = on +5 ti aaa Crophcing ‘6 with a) Se, g(n)=l00n The consol go be eessted © 3 don) = © gen? fr (M2 ‘ {3 We 28 welon+s 2 WOO fdr nzo Bris claro she above wlabone thal c=100, 900) =p and m=0. ty dekniboN, #n)=SLCgcm) , x Le LM=DL Cn) | 153 0 (Big - theta) peAniton : Big-@isa measure 9 the lear as ell ay ngeit canned oN by a til tocanpléte. let An) be the camplendy gan Lynittrn . The Lunchon An) 6 said 40 be big-rhe tag 9(n),clenoted Hn) = OC gCn)) Such thak-there emits eme petitive cmipants ©1,Cy and - rn—negabie inkgey No Sab ofyting the casramt, PTO Venkatesh A. Bhandage M.Tech, (CE) Asst. Prof. Dept. of CSE TCE, GADAG ¢ (33) ci ¥4Cn) #(n) < Cox) forall n2ZNg %, i wedraw the graph #(n), C1*gLO) and G»gCln) venus n, the graph 9 #(n) Des above the yp c1eg¢n) and les below the graph ¢- cot y(n) Ay suthdintly large value 4 a'as show below: ‘ dn) ba) ugper'beund Hn) owen fanedioo) 19Cn) Lower bound 5 N% Uy used do conote both lower bound bumper — ts This notabod mJ usthin acon saad Aebyy found ona fanchon t0 49 Ld Hn} = wont & » Enguers Fly) ting pig-thele . Soluhons Tre constrain tabe sebrhed ier | clegin) 4 fn) axgen) ay 026 . =e meate 4 born fr.02 ys cleay fos the above velaons that Cia @=10S | Mm=190) =9.& By Lehi lD, pend = O.C gla). loo*e 1 Venkatesh A. Bhandage M.Tech, (C E) Asch Prot. Dept. of CSE TCE, GADAG Gw pods Magic Fyssre_ | piston: A crag Square is fag numbers Storecl i P-D | guch thal the Sum jceme ys in each ww, clamn an Lragiaal ave Bune. he sine g the 2-0 AMC mist be tl xl, york be odd Dre so al. bore elements 7’ -D arrHY -) mosebe We. . cede sconsiday a Square marin a (quer by Grete )d9 gener LA Feupolicad 0)’ fal- the value’ athe middle borg the lop e . m-(er-He postion be Gy): Li pow ihe fie bor and enove lebt-one, bore while mo left #0e iricl thesquare's boundary,/her oa . ‘oe Woe nideg the square. .le-Cr09 oD) js whe pos AOD. : aS. sof: 2P vale in the magic rpve ak (onjeal) iseonps Hho Cj) < Cow, ol ). + Seon A gl Shep 3s 2 aragicLn) cal) 15 Mo emphy,/hen aove olavor7 Papacy next yous by mnoremeniing 7° By 4: Sat bile meving chun, Poe ge byond She pee boundlary, ther fails Fe onthe ofporie side 9 the spate. (seg 4.3 Fert next- higher number in magic squabect posit (yj gs: pend Hath 2p | al abl the spac are le | Pesign's: Ine detled deagn ah ve mocec! Net below s. anipallzahor!s pssugne Teel to ‘3 2 ath W29, anidatly no elements ave placed -ms ig» melicaded. int : \ 7 2 aliting the medi (6/05. 3 2, jit magicnacrg=f{o} wes 42] 32 9x5~ Ihe yules to be Hilo he a magic Squaeae below: ofe e1o a] 3 | > gas Venkatesh A. Bhandage M.Tech, (C ED Asst. Prof, Dept. of CSE ICE, GADAG 4 (ebalaahon F Apu pluie, mC 9 Feumber | ine addleg of | Ww (ae Can plele any nukbey ‘ ® Shaw here's ig mnitial Valles: 120, j22 NES , 18 §2Gdb=Cn/g n.i20, 520-02 marae! Seq Lt ne upulard movernent-Ts obfainedl. by subrachyag 4° Fern t1/ 16, i-L)a#-the value "7-78 negabve,then cartier @ boot on opposite Side the squsie bY s/hn9 sag. 26D = CO) 1 osheraite SHOW gosihan +o | Thus opward aewvements obicinedl wligg saement : lywoG-120) 7 Cn-1): Cit lye left mcvemend iS ebicinedl hy -subsrachng | horn. 1G (GD. TAF WS megabve then corsidaya box gD ofpe| se ide g the square by $eHiN9 Weg a(o2 @) Otherusie, seb (ol posh do’ j= Mug, lett erovement 7S given HY col =(j-140) 2 Ca-1) (G1) |» az BL ynluein fhe erage square a Crow,col) 15 eangly, hen Ch j Ko, col), fis iS achioued a3 At lows i 18, | £Caregyc Loi Leol| = =0 Afofofof op : Is. 2 ° } ° ° a} of 0} 2} 9} gh9 19} 0 |- 9} of a} 0] ow Sig 3% Ini Mearene 1S objained by inoemenhng x fy 3 idene by wins anod“operaH os) a4 chao beloco = OPO) [Lemove chwnwarde, %, jE ji ol Her canbe ob-Kinec! Sq canky Hong sips & Sep as sree bes: V@RKGIESA aie eee M. Teeb, (CE) Asst. Prof. Dept. of CSE TCE, GADAG (av dl megiclwu\col| ==0) j=yww, j=l ese ta CGH hos Fastrt Zak gosto Ci,j) ie mre LALD=2. Barepeal AP 1 3, Saserd ‘3\ ab posihoo (ij) iG magic LOLI=3 J repeal-sp ido} ‘ ( | Sate 95 ab pean apis eagicl BL J each Sap PrOCeSS, ‘seat.’ al petition Cig igoragicl ok Ark=26 25 dr kar buen, Generally fanchar loginerade mee guareTs ger by ¢ void oreGic. sqlare Cab meghe PY MAY-SI2E), iat O { fb Ljkww,cols 720, JRCn-Ns magic LE D=U fyCk=2; k2=a%n; EHD) nf wwo=-t4o)! Ca: G1) Lup posi. wl =Cj-1 4092 Card +Cp05 Y cebt pesitiooy. if Coregic Liss\Ecoll==0) tx100, Jacels else 12 CH) QS 5, oe CALIHk, d Funchon & pom 2-D anrey void prwl-rradkria Cin aL ILI) wt 2) { iat hy hy (i205 2) jb f SEER yy mont('Iad" cic} payee’) 3 4 ue PIO Venkatesh A. Bhandage M.Tech. (CE) Asst. Prof. Dept. of CSE ICE, GADAG 2) /(Pngrase 7 gerwrade reaps Fite. thinclades sido h7 Hincadezstdlibh> ddehne MaAt-SRE-\O 1/ Fatlide Aunchen by gnerahag regi Spare S punt 2D. void main() {int aegic LLAD= $04, | pint Enver Seg Spat {o's WL (n9=>0) rae [ grinycomagic Suave oct not qutis]o); outlo); Sn [Naz HOY-SS2£) { pl" org vange\o"); enit(o); J ccandl'td\ Bnd: nag ic_sguare (magic, ists 1D P4 10 A " 41 4 16 [ral 7 [s [23 puinip( "Ine anagle SPAN Sle Ne eae gr arasnin (Aree. P74 3 pializ [io 3 AU 2425] 13 | 16> | peacracee COMPEXTITIES (1.8, whadis used rokry me complorld >| By canparing the me canpleodhes ¢ #00 alg cn thrns that pardon she Same dash wecann derevdbare eohich alg onihen 18 - beer. &x; eb bme Carnglend fy opera P % OCr whore orders 4] Ce bane cornplenhy gp programa 8 Blo?) whore ctolr if 2. §ite the ordorg' pS less than ardor 9 ‘Qi the prograsp! 8 fesdey phar’, sl ne pme Carper an algonthen is Mom cred. a on) en h paits ‘pianay beo af AUG ow, dhe behaviour g copier changes ascrcor 9 I? charges cg Ds thown %? ‘ ) ie io Pio. 44 Wt Runni dime iS hnexr, be Aq Ws Runa} a f\9! | Wl tagons dined Sadorel Po gesthors ma atl per, problems f | Venkatesh A. Bhandage M.Tech, (C E) Asst. Prof. Dept. of CSE + ICE, GADAG lon [nN [wleon [w® | w> o ) eo 1 | | 2 2 4 q fe 2 | 4 3 6 | 64 6 zy 3 g Le 6q | S12 | 256 40820 4 | K 64 [ask |aorb| 65536 1 high S | 32 LGO [4 768 | A914 9612-16 ae woles fy camping’) ‘and Wa is obverved fomrriy aloe nbd “thal oxp patrtal Aanchion groves voy fase even ty trol vantabeng ‘when canpared nv’. lls adit ghaf mincing Bere 9.4 pregrann 7s conga | lg alt Yuvoms, be a prograan’s logan thnic leganithanic Aig ruori ag Time occas 4 programs that solve Ae problem f ii she poole sre 4° acasiay! fackyay ece Hirahon 9 re log Coes nay earth ), [egal + vuneing hare e ‘why. Ine dwvicle§ Grquar gor) hans shay qhick sort, onerge sort ede All ( haverhis bere. ame S qracdrabe, Tealgosthns normally wall Fare 2 ( (cof: fo Magble sort, seledon sorb,d aragia addbin, Ne: Fhaora re 5 cabic, Mill have 3lops Gi rrakix [onclUiplic Ms Runrang dmeg an algorsthrre agerenine, &: Alga tha? gor NF subsas 2a. gwen Sth. Cmokel ere. C tus frce technique e70 | ms => = be Venkatesh A. Bhandage MTech) Asst. Prot. Dept. of CSE > TCE, GADAG 44) he grapi> Shouss plr ¢ varieus Hematite as Wy chaye} 4), 3 : = hdumance Measurement? L anks cnsidans how das? the algonthmn iS oxeceuted in our - sae Ire mreaiuure 9. how fast an algaithn if ir Ned on aspeute machinBand how ethical she sien i luses the spate onthat mathine daning eeecehiarns whnorane mreasanmend. Redomante measuyema-aith wept to bine casi he objaned Wiig Wo mbhods, Using clock Munch on.2 Mors Yunchar yelurns the anwuaty ——Gassor Aime that has elapsed inte the progranry begat) Srecouing, where dpe iS clock-b, Totind the dime we ue the clock funch 0 gute Nahe pregran? onteal : Sait ¢. preeveatb onl 9 the event, ; mne difference. puween Sap one and Harrame ges He procestor Asn dy she acbvily co be ee Oe h ve inls Seconds wk divick i+ by "Fhe # Cke por Secon | is jceeobhedl using 1he Syanbel) ¢ conftant Aes FER SEC Roya f A. Ww) smi = heat yoid maint) ' £ jab acre) t same BS bk £0 Ait i yar Cer PA aaah WO” SUK, vc Ap? p4ro5 itt i alare Sanh! ‘a ill Gaca oe ysar [iS as bale] 1.0, p= hace). ercl= & Sr ievesint) bcs £0 ‘rug = sili + Sep ptrrhy fl gvinie “Suen g anay element = shel ‘tum 3 Data Studies with 4 Assjsnrnends. - UNIT-Z ¢ GASIC CONnCEpTS . 16lo lor ) ane poner variables 7 hew 0 declare pairyey — | va ed what ave the various memory allecaHon ssnae loin how menrory com be dynamically located) wirg- ne z J " - lain with memery clagrams head memey can be lyn eed ctlocated ating callocc) & veatlec) Fundions | what isthe cifloence between int a and tat a£s] and jt e037 Debne a printer Puniba 6 Puntton Jo suapaue nara jens wing powers . whal is an algen'thro | explain He cmeria thot an algorithm nut ood “pl write a FancHop jo sork ‘h auenburs unig selection soe. Blso wre she program Ar the same, waa program do implement binary search. wha ls recursion Pvohatare Mevaniots fogee gueratsion? lo} what 15 an HOT ? Bre#ly ai the cakegenes al clasohy he Lanchons ¢-4 data fe. wake an ADT fer naturel aerrbey « har is pubyeance aay A Sxpoin . a compleal 4 Snplain faed Spate repirervent| B vanedle space veyirerrons . ho ew x wy ry SF, A \D OS 1 r 13), ua FS Hime effecrency 2 Bxplatr Hu porocedure +o find due dtme e4grcrenty using counting mednod & tubular method. XD 'S)| Eoplair — peargormmance measusument 2 16] Wnuk = *8 Asymptobe notet on 2 LaPlaro Brg 19| Dehne Date ordre. ses wiiea camplele ¢ piogiaun ¢ fae furs omy ebmerty Ung pone . 1) nea comple prepare do swap suo numbers using {- Compleat ty hOnat % dfme offocrenes, 2? Pelkarmnme due time He complex?ty of an Pteorabsve and oe MUST PvE punchon quot adds n elements oF Fut cuvrayy using ftobulan me Hod on aotatun , Brg Oo7gja notdioo , BFg~ Tu fal nok fon wrth = gutaph Define By oh notubes 9 SuOW fuat 30F2 eg equal ota) % cosvuct 2? poirters, s

You might also like