0% found this document useful (0 votes)
114 views8 pages

SCH 18CS42

Uploaded by

reddy1984
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)
114 views8 pages

SCH 18CS42

Uploaded by

reddy1984
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/ 8
1 be treated as malpractice. See USN 18CS42 Fourth Semester B.E, Degree Examination, June/July 2023 Design and Analysis of Algorithms Time: 3 brs. Max. Marks: 100 Note: Answer any FIVE full questions, choosing ONE full question from each module. Module-1 1a. Define Algorithm. Summarize the properties which make the algorithm best. (08 Marks) b. Write an algorithm to find the sum of first and last digit ofa given number. (04 Marks) ¢. Define program basic operation. Write an algorithm to find the sum of a numbers, also find the program step count for the above algorithm using step count method. (08 Marks) ORS 2 a. Write the Recursive algorithm for Tower of Hanoi. Prove that the time complexity is exponential. (08 Marks) b. What are Asymptotic Notations? How these are related to time complexity. Give example for each, (06 Marks) ¢ Discuss the important problem types,-with one example for each. (06 Marks) Module-2 3° a Discuss the General Method of Divide and Conquer along with control abstraction. Et (06 Marks) >. Write an algorithm for MergeSort. Also demonstrate the applicability of Master's theorem to compute the time cdmplexity of MergeSort. (06 Marks) & Sort the below given array of elements using QuickSort, Mention Time Complexity. 2[6]4[3 9 fit}7 y (08 Marks) 7 OR 4 a Whatare the disadvantages of Divide and Conquer approach? (04 Marks) . Discuss decrease and conquer algorithmic technique. Explain its variations. (06 Marks) Write an algorithm for the below given problems in divide and conquer approach: (@. —Strasson’s matrix multiplication Gi) Finding maximum and minimum element in an array. (10 Marks) Module-3 5 a Apply Greedy technique to solve the following instance of knapsack problem: W,W,W, = (18,15,10 n=3,M=20, a ‘ ) (08 Marks) VV2V; = 30,2118) b. Differentiate between Prim’s and Kruskal’s algorithm, (04 Marks) ¢. Solve the below instance of Prim’s algorithm to compute minimum cost spanning tree. Mention Time Complexity. (08 Marks) = _() Ql / ala 6 oz © Fig. Q5 (©) 10f3 18CS42 OR Find the shortest path for the given input using Dijikstra’s algorithm. Consider source node as ‘g”. (08 Marks) Fig. Q6 (a) = Define Heap. Write Bottom-up Heap construction algorithm. (06 Marks) Write job sequencing with deadline algorithm. Also obtain an Optimal schedule for the following jobs with n= 5. Profits = [10, 3, 3, 11, 40] and deadlines = [3, 1, 1, 2, 2) respectively (06 Marks) Modul Compare dynamic programming and greedy techniques. (04 Marks) With an Algorithm, solve the below given graph to compute transitive closure. (06 Marks) & 7 Fig. Q7 (b) Solve the below Travelling saléspeison problem using Dynamic Programming Technique. Also write on algorithm and mention the time complexity. Y [o 10 15 20 50 9 10 ) 6 13:0 12 Fig. Q7 () 88 9 0 (10 Marks) OR Construct an optimal Binary search, tree for the following four-key set: A [Ag Pay fAy| 1 fej2 1 J (06 Marks) ‘Write an algorithm for (Floyd’s) computing all-pairs shortest path. Derive its time complexity. (06 Marks) ‘Write a note on : (i) Reliability design (fi) Multi-stage graphs. (08 Marks) Give the control abstraction of Back tracking. Apply Back tracking technique to solve the sum of subset problem for the given instance, $= (5, 10, 12, 13, 15, 18} and d = 30, Illustrate with possible state space tree. (08 Marks) Write an algorithm to generate the possible Hamiltonian cycles using Back Hacking method and solve the below instance to generate possible Hamiltonian cycles. (08 Marks) ac... i Gascars ieee # oy NS a 9] ‘i 6 Fig. Q9 (b) Compare Branch and Bound and Back Hacking algorithm design techniques. (04 Marks) 20f3 18CS42 OR 10 a. Solve the below instance of Job Assignment problem using Branch and Bound, Job1 Job2 Job3 Job4 jo 2 7 8) Persona 6 4 3. 7) Persond 5 8 1 &| Persone 7 6 10 4) Persond (08 Marks) b. Solve the below given instance of 0/1 knapsack problem using Branch and Bound technique Tiem | Weight | Value | 1 4 $40 2 7 342 | 3_[ 5/925 4 [| 32} sv : (08 Marks) ©. Write a note on NP-Hard and NP complete problems. (04 Marks) wenee 30f3 Visvesvaraya Technological University 2 220418054245 /93 Belagavi, Karnataka - 590 018 t Scheme & Solutions Signaturé of Scrutinizer Subject Title : Design cand Raalsgis of Alejo ten Subject Code: 3 cs ‘t nalegis Of Major ition Wd HA Question Number da Qa: o Solution Definition ~ tar ks « properti ep a masks « [Dapat , ont ent Dofintencas 1 Tiniteness , Effeciveness Mastin : Defiwlian --B marks @ aah = molt @ Bioekieds—— & ¥deGerods » SR ow = Goyeots “Towa of flaan’ ~ Recursive Algatitinn 4) Arty — Thon Com plow ile -~@ Asymptotic Not ations 2 -sh (0) { Befrctin - @) Ly Marks - (ay by athelx (0) “Exanple fel ents By ba- a) Preblers Ty Pes * Graph Prablems ~ Combprrotatrel Problems eee Problems Sad Pek lemt Marks Allocated g - Sih ting Orvedlems Gyeodi cal Probleme « BMA oh Number Subject Title: Dedign aud tyssa ay Morin, Subject Code: 18 C&G Q Question Solution aio Bal Dwde Allocated Aira SAiy 4 Bride one ae Carroynet oo @) —@iNe example Combed ths Rakin * Tl) = at (nul) @ Merges & Ay hte _— ©) Heol Master tHhestem le Compelt Hwe oF Th) € ‘ae § otatey) i 6 3h at etnies) epaset mt Cond 2 acl mfarererged (Gr! show Sher ae “hw Comploni tg ~8 olalegn) —<@) Ope 4-23-46] Tinea Cerne BO Enbegn yD ba] uacbekim 4) Bisdey Cohan Cn 7 1@ ( kat 4 Pots) ond La -Fectusg ve Slee Decreare Conny ate 2 vataki ong > Docroure J 6 Decmrare Vrartabte a Constant Gas ox Consbent qfeele” ia Sao clecneate 7 4 a or “Hahn Ks SKatens Moty soe © Mabie te [pod Mertrand Min lease Oo 0 D abn avd Analy Ah Algae Subjoct Code : lecsug . Marks Subject Vitle : Question Number Ease Allocated Say Eble. eLrmpwe PW velued + 4 JB 7hG She a LCL 3 to 18 4 ig 20) S 7 1g 30 tofg=O-S6 6S to-(w ¥o-s0)) | =o : z Los,o-06,4 de gaat e eo “3 et da “beta seon Prost hegiskalr ’ ru ( oce + Vie) | of eh ey v) ett CH] stun Veto Remeininy Verbides at,-) a Ce) bla 6) CU, welds) clad) a (C2) bCAG) © Cyn) ele uy) ale vay b(e, 3) aler » (e\3) bled UM), MST = DIC 4 Cs Et GrA4 Ese > U4 wa gts = Iy 2% Ole Seanmiend oe os a eppedoc A 1m Subject Title : Subject Code : Question ot sha- Ab Number Solution ana Ga.) sds gp 8 q-e 26 HC-d ec Tyce © abo C-S2 1d qe pr Fs Ee GG — 4m ate fh Bottom up ne — TH kaquenclny Hid clendbahs — “an bess oh ss 3) ~Fotel Tapet Pet Tyo +1 F0 = 61@) Comwparcis em - wv 4 k PoAnts hyur@ 7 Poids Reaacrvel J Selubion . aa ee {a , RR R2 RY ei -|) it 00 1 oO \ Show a Ie SEP” : glar¢d= Care Sa re 276 Kaalkion | ACaucp) = Cyt = = oe Urs $203) = vias 3.) Aart : Coe Steet A Smank, \® © ‘Godt Subject Title = Subject Code : ee Solution bale be: oe a Shake G és) Ag, saci Conta [© ce | eeu 28 les 8 C Rabat lly Besyn + mulls. Svege wer} @ aa Combe Abstraction +> — @) glve We problems — © me © Sik spe eT oe, Sirsa gold ts 7 oe 44! dite — © re PT pwns Lote tg OD Ge eon | a Comm aeribvimn ~ wy Y powts ) foul Selidiven Pom 4 ae 7 Pern > — Tee) (®) Porm & ~ 363 6 a-THu. - Depa A clos ante ee By Saucy Art an a Qreblent — Qacly © wo Couple Arblemg —~ amortt «

You might also like