You are on page 1of 30
KALINGA UNIVERSITY RAIPUR SESSION: - 2021-22 (MASTER OF COMPUTER APPLICATION) TOPIC: - “DATA STRUCTURE AND ANALYSIS OF ALGORITHM LAB” Submitted To KALINGA UNIVERSITY RAIPUR C.G. GUIDED BY: SUBMITTED BY: Smruti Smaraki Sarangi Pooja Singh Thakur MCA 2" Semester Environment No. - PROV/2021/0007964 INDEX 5.NO. PROGRAMS 1] Write a program for addition of two 3x3 matrix. 2 | Write a program for multiplication of two 3x3 matrix. 3 | Write a program for upper triangular matrix of 3x3 matrix. 4 | Write a program for lower triangular of 3x3 matrix. 5 | Write a program for transpose of 3x3 matrix. 6 | Write a program for performing stack operation. 7 | Write a program for converting infix to postfix notation using stack. 8 | Write a program performing the linear queue operation 9 | Write a program performing the circular queue operation. 10 | Write a program for linear search. 11 | Write a program for binary search. 12 | Write a program for selection sort. 13 | Write a program for bubble sort. 14 | Write a program for insertion sort. 15 | Write a program for linear search using function. 16 | Write a program for binary search using function \. ee ee ee Cask co pragrm dor addin of tee Res matin . Hinclde cetdioh? Hnclde ; y prin ("Adios 4 eso peadin ort? Chao}. i225 044) ¢ ej: Meee ecgaga: abitGgy POTN Pe ot sutton \ mada tes \n")5 iso; 12.35 194) oe (" The Rr Geo sgee5 jy panty C" ZAK” . LUIGI); pnt] CWDS 5 g Oubpub a Enter he elements -\ fist martin 8 2x3 Erker the clement J second wmotin! oddikm a to mobices OT! Fhe vtsultont mohin iS! 2 3 12316 G2tt 0S ° ay S466 SIR 2, boxik a pwgom gor nuclh pli cakion — ef two axa mothin, trinclode At include 2 cowo-h? Vid moinO c wt af2ttst, His SCag vel Teal aN AS preg C'taky the element gf dink clement Sn'Ds der Ciro 5 yeasiet) for Cj=0 3 423 35+) scon| CK gat; a pany (Eater the clements ef second cement ADs Yor Cito; tease) a dev Gro (ees 5t) 4 . seon| (OKAY, LUIGDs BS pant] (“multiplicahion @| hoo mein ore} \u YD; der Ciro; tea3itt) aC g , eR der (gro sess : der Choo > ke25 4) | Re CUIGI <0; CUIG Tc GIGI 4 oC + HTKICGI 3 3 prvi] (7 The seauttant matin iss \u‘); der Ciro 5 }<2 5144) der Cjr0 3 G42 3a) < panty ("zd OY CITB 9S s pany (wr s \ Oud pute em Giker He denent 4] frat mates Ke Enley Hoe ebencent @f tecanl woth muttipcain af hon advices ore * Fhe strulbont matrix ts: 2 S26 fs tt N9516 ee ee? a 3443 S44 bork io preg dor Upper triongJar matn x {.4 ya matin Hinclode void moin() x tnt oTe3 Usd, Uy: prank] CU Ener the clenents oJ the main IW: -, Cizo 5 tea 5 i++) «Oy a « AN : sean} (4d, & aliIGW; S pant (The upper drangular mabin Va 8D; der G03 i233 yw) 4 pang (\n")5 E Cjro5 G<2 374) ba Gap 4 pinkjZd, of3); s else « s pany (74d \A%, 095 $ E: } Oudput ge Make de Hemeds 2) the mahin 2x Z \ The Upper tyongular — matix 2 FES 12334 o 2% ° ° ° Ss egram dor lower triangular ea 58 fer Hee Pao a decends of He pickin \'D; ("The leeser Ariongules mobin: \n"); 3 1<35 744) ay Gee X< oiaty Za WPS ol TG1s f Bice os) UAs 0) Outpub 4 Pacy Mle. aicient | d+re matin axg ik hs Bey Asongular wrath x ° ° > o 1o%u ° a #ices 12924 va 78 fA actatyDs yo oN Oy Oukpub Ste 2x The transpose cd a mabin he tronspore mahin cewenk ot + 3 F225 12934 1310 \204 ° airs 560 ik Grit o progvom peqoming ae acl Operon. Finclude vord push Cyoid 5 ypid pop Cid); void diploy (oid): Trt ywosn() on shack [edd , choice pn, top, 15 top = -13 pan C'\n kr the se q stock eccsc= ico) 5 prank} (10D; Sean|( ZI End> pen (r\n\t STACK OPERATION LIING Array); ec eS panty (oO \n VE 1 push \nlt 2 POP Wt 2 DISPLAY We BESt 5 do Tanly (Xn Ent the dice 2) stan] (1%, E choice); aS pall Crater co value to be pushed Of scowl ("Zid 28s op aa stack [topT= * > $ Ba pop © < Core) e panty CAAT shuk ts underflou »; } else y, A panty C7 \t the popped cement is 7% 7 stack Cop); top --> s e Cay yerd display © a J (toe pro) ¢ tn shack MK); paint ("\n Hee ement fr (ie Hr ipzosi-D panty (\n Par trent Chaice ys % else ‘ant ('\n The Shack ts emply 3 s a Gulp 6 = Euler dhe sire ef Stack mon 190 us Stack operation. Ling Army 4. PUSH 2. POP 2. O\SPLAY 4. EAT Euler the Choice =) Beye peice Gokcpestes =? Erker the Choice +1 Black ts ever|iom Eukty he Choice + 6 Please Eker oO Valid Choice Bt. Cox rile og PQm™ dor Fa as ing to Porttin notohicn using Ghecle , Hinclicle = prion ty Ce) prink| (1%, pop Oo; purh (Fe); \ cat > while Ctop!>- ) pant] C%¢% pop O)5 5 5 xeluwn 05 Owpub Fo mkv om infin exprytasin = ecra eso er?) Your min rear) a print] ("Element deleted Jom qreve fs Zd \nquee); evry CyvondS 5 dreonb = font 415 at Noid Bp oy 0) int a5 | Qe == >) Por (7Queve is emply Au"); else ‘ @ mind (C’Qscue 3s: Wn"); ger Cie dons j ccvear sit) printy ("7d *, queve array CIID; print | CA\n") 5 2 Bi . Ovtp os Qi Bevis Aalie cHo dwerkd Value 220 Ynserted Valve > 2° Minserted Velve > 40 dyserded Valve + S° Gowe is Over} lous 3. Covile eH pragyam performry the civedan weve operation Htinclude H define size S void insert Cink in) wid delekeg(intlI)s vid disploy Cnt); int ront = 5 jut queve Cred; do 4. print(("\w\n Cirslor GQueve \u 1. lusert la 2 Delete Mn 2. Digley \W o.bal") > prank ("\~ Eker Choice 0-9 22); seen) Aa ch); Sowith Ch) A care 1: print Cn Enter number 2) scan] (1% 3" & »); insert queve ,n); breaks case a: delete Cqueve )) break ; case 22 clisplay Cqveve); bytak 5 BY a while (cbl=0); 3 36 AG itar +s size ADU (Fronbs sammy +1) J Cqueve is jul! a; eve Trtard sik void deel Cink queveCI) (Cfent = = = ; pray C’Queve hs na; else Af Cfrent = = rear) mi C\u td delek® queve Het); ee O\n"D; > veny) bw 3 jesize 5144) awh “Z%d" ,qveve iD) 5 Cizo 5 i found */ a pos GT = = seord) 7*4 required element df ieee is present Ae vata Ay We seards,) +) 5 5 3 § C= = noe) pirl("Z3 i pot present in army Xe ent iw w', search); gechO; [ 2 weber elenents in Orr 5 vorbert 4. search al joeahor 3- 4s Grier the nowber is present th bile a prog rons ger binary seard. ANindude (Fist tlas/2; i) Girst > last) pant] C/ Nok dovnd Zd isnt present im Lit. \n") search J; the gelchO; 3 Oatpuk 10 — Enter de nomber 4] elements ¥ Enter the # integers 4 s 3 oS 1) ne 42s Enky the im is value 40 Lind ford at tocotion 5 a pregcum an aeHon 4a include 2 abdiob? include euwieh? a. td Byrn toon» G78 BAIP! Bra; E viler number pewerds Ww"); prints ("6 gan) (118%, 00) mi Ce uber ZA integers wt ns eros conse seand (73%; goes )s ‘g Wea ene 440 4 (dio dene c-1 jd 44) a) Corral onreg (AsiI) 4 bor deceonsing Wie oe jacteod 4 8 / gusop « corals arregt as: eer (hy arry(he) » sop, d * | 5 pref (Haorkd Usb me oactnding onder NO); Cone yeangers) ping C78 Ss ghd Oo owvay CTY, WW. Gk a prgrom der bubble sort SHnelude thinclude wid moin() Wnt avrny Ciood .» jUyey positon | dlyserQ; pany ("Cake norber gl element \n") scan) ("Z2~, 5 pr (ke Za in ~ (cz05;e
avreny Cad position =a5 If Cposition |= a= avrey lh avray(ed = arey Tpsihond; any Cposttiens ate pany C" Bored Ust Tn ascending C<=0 75 C£%5 ct) Br Ie is No d . “dd \v", ovvay CD); getkhO3 1, , om tenant Bete: Ae):

You might also like