0% found this document useful (0 votes)
38 views3 pages

4th Semester CS Question Papers June - July 2018-1

Model question paper
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)
38 views3 pages

4th Semester CS Question Papers June - July 2018-1

Model question paper
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/ 3
CBCS Seenae USN | 15CS43 Fourth Semester B.E. Degree Examination, June/July 2018 Design and Analysis of Algorithms ‘Time: 3 hrs. Max. Marks: 80 Note: Answer any FIVE full questions, choosing ONE fall question from each module. Module. 1a, Write an algorithm to find the maximum element in an array of n element. Give the mathematical analysis of this non-recursive algorithm. (06 Marks) b. Explain the asymptotic notations BigO, BigO and big theta used to compare orders of growth of an aigorithm, (06 Marks) ¢. Explain with an example how a new variable count introduced in a program can be used to find tite number of steps needed by a program to solve a particular problem instance. (04 Marks) OR 2a. Write a recursive function to find and print all possible permutations of a given set of n elements, (05 Marks) b. Salve the recurrence relation : M(n) = 2M(n — 1) + 1. Take M(I) = 1, M(n) is given for api. (05 Marks) ©. Define algorithm, What are the criteria that an algorithm must satisfy? (06 Marks) Module-2 3° 4 Write a function to find the maximum and minimum elements in a given array of n elements by applying the divide and conquer technique. (06 Marks) b. Explain the divide and conquer technique. Give the general algorithm DAndC(P)[Where P is the problem to be solve] to illustrate this technique. (04 Marks) c. Apply source removal method to obtain topological sort for the given graph in Fig.Q3(c). (06 Marks) Fig.Q3(c) OR 4a. Explain the merge sort algorithm. Illustrate with an example and give the worst case efficiency of merge-sort. (08 Marks) b. Apply quick sort algorithm to the following set of numbers. 65, 70, 75, 80, 85, 60. 55, 50, 45. (08 Marks) 1of3 15CS43 Module. a. Apply greedy method to obtain an optimal solution to the knapsack problem given M = 60, v1, Wa, Wa, Ws, Ws) = (5, 10, 20, 30, 40) (Ps, pz, Ps Ps, Ps) = (30, 20, 100, 90, 160). Find the total profit earned. (04 Marks) 6. Explain Huffman algorithm. With an example show the construction of Huffman tree and generate the Huffman code using this tree (06 Marks) c. Apply Prim’s algorithm to obtain a minimum spanning tee for the given weighted connected graph. [Fig.Q5(c)}. (06 Marks) Fig.Q5(c) OR a, Explain the bottom up heap construction algorithm with an example. Give the worst case efficieney of this algorithm, (08 Marks) b. Apply single source shortest path problem assuming vertex a as source.[Refer Fig.Q6(b)]. (08 Marks) ig.Q6{b) a. Explain multistage graph with ai example. Write multistage graph algorithm using backward approach. (08 Marks) b. Apply Floyd’s algorithm to soive all pair shortest path problem for the graph given below in Fig.Q7(b). (08 Marks) Fig.Q7(b) 20f3 15CS43 OR Explain Bellman Ford al to find shortest path from single source to all destinations for a directed graph with negative edge cost (08 Marks) Apply Warshall’s algorithm to the digcaph given below in Fig.Q8(b) and find the transitive closure. (08 Marks) ‘OL Fig.Q8(b) Module-5 Apply backtracking method to solve subset-sum problem for the instance d = 30 and $= {5, 10, 12, 13, 15, 18}. Give all possible solutions. (08 Marks) Explain how travelling salesman problem can be solved using branch and bound technique. (06 Marks) Define deterministic and non deterministic algorithms (02 Marks) OR What is Hamiltonian cycle? Explain the algorithm to find the Hamiltonian eycle in a given connected graph. Write the functions used for generating next vertex and. for finding Hamiltonian cycles. (09 Marks) Apply the best-first branch-and-bound algorithm to solve the instance of the given job assignment problem. (07 Marks) Jobl Job2 Job3_Job4 9 92 7 8) Persona 4 3 7 | Person b 8 1 8 | Persone 6 9 4_) Persond veer 30f3

You might also like