18CS42 Model Question Paper-1 With Effect From 2019-20 (CBCS Scheme) Usn: Fourth Semester B.E. Degree Examination Design and Analysis of Algorithms
18CS42 Model Question Paper-1 With Effect From 2019-20 (CBCS Scheme) Usn: Fourth Semester B.E. Degree Examination Design and Analysis of Algorithms
18CS42 Model Question Paper-1 With Effect From 2019-20 (CBCS Scheme) Usn: Fourth Semester B.E. Degree Examination Design and Analysis of Algorithms
USN :
Note: Answer any FIVE full questions, choosing at least ONE question from each MODULE
Module - 1
1 a. Define algorithm. What are the criteria that an algorithm must satisfy? (08 Marks)
b. Write an algorithm to find the maximum element in an array of n elements. Give the
mathematical analysis of this non recursive algorithm. (08 Marks)
c. Distinguish between the two common ways to represent a graph. (04 Marks)
OR
2 a. Explain the general plan for analyzing the efficiency of a recursive algorithm. Write the
algorithm to find a factorial of a given number. Derive its efficiency. (08 Marks)
b. Discuss about the important problem types and fundamental data structures.
(08 Marks)
c. Explain with an example how a new variable count introduced in a program can be used to find
the number of steps needed by a program to solve a problem instance. (04 Marks)
Module - 2
3 a. Write the control abstraction for divide and conquer technique. (04 Marks)
b. Design merge sort algorithm. Write a descriptive note on its its best case, average case, and
worst-case time efficiency. (08 Marks)
c. Discuss Strassen's matrix multiplication with a example. and derive its time complexity.
(08 Marks)
OR
4 a. Apply quick sort algorithm to sort the list E, X, A, M, P, L, E in alphabetical order. Draw the
tree of recursive calls made. (08 Marks)
b. Define topological sorting. Illustrate the topological sorting using DFS method for the
following graph. (08 Marks)
c. List out the advantages and disadvantages of divide and conquer approach. (04 Marks)
Module - 3
5 a. Solve the following instance of greedy knapsack problem where n=4, m=10, p = (40, 42, 25,
12) and w = (4, 7, 5, 3) (06 Marks)
b. Write the problem statement for job sequencing with deadline? Let n=5, profits (10, 3, 33, 11,
40) and deadlines (3, 1, 1, 2, 2). Find the optimal sequence of execution of job solution using
greedy algorithm. (06 Marks)
c. Define minimum cost spanning tree. Write Prim's algorithm to find minimum cost spanning
tree. (08 Marks)
OR
6 a. Obtain the Huffman tree and the code for the following data (04 Marks)
Characters Frequencies
a 10
e 15
i 12
o 3
u 4
s 13
t 1
b. Write an algorithm to find single source shortest path for a graph G whose edge weights are
positive (08 Marks)
c. Sort the given list of numbers using heap sort: 2, 9, 7, 6, 5, 8. (08 Marks)
Module -4
7 a. Define transitive closure. Write Warshall's algorithm to compute transitive closure. Mention its
time efficiency (08 Marks)
b. Apply Floyd's algorithm to find all pair shortest path for the graph given below.
(08Marks)
c. Explain the concept of negative weight cycle in a directed graph (04 Marks)
OR
8 a. Explain multistage graph with example. Write multistage graph algorithm to forward approach.
(08 Marks)
b. For the given graph, obtain optimal tour cost using dynamic programming. (08 Marks)
c. Write the difference between backtracking and branch and bound. (04 Marks)
OR
10 a. Explain the class of NP- Hard and NP-Complete. (08 Marks)
b. Explain LC branch and bound concept for knapsack problem. (04 Marks)
c. Solve assignment problem for the following job assignment and obtain optimal solution.
(08 Marks)