You are on page 1of 16

18CS42

Model Question Paper-1 with effect from 2019-20 (CBCS Scheme)


USN

Fourth Semester B.E. Degree Examination


Design and Analysis of Algorithms
TIME: 03 Hours Max. Marks: 100

Note: Answer any FIVE full questions, choosing at least ONE question from each MODULE.

Bloom’s
Module -1 Taxonomy Marks
Level
Q.01 a Define an algorithm. Discuss the criteria of an algorithm with an example. L1 6
b What are the various basic asymptotic efficiency classes? Explain Big O,
L2 8
Big Omega and Big Theta asymptotic notations.
c Discuss about the important problem types and fundamental data structures. L2 6
OR
Q.02 a Outline an algorithm to find maximum of n elements and obtain its time
L2 7
complexity.
b Design an algorithm to search an element in an array using sequential
search. Discuss the Best case worst case and average case efficiency of this L3 7
algorithm
c Discuss adjacency matrix and adjacency list representation of graph with
L2 6
an example
Module-2
Q. 03 a Explain the concept of Divide and Conquer. Write the recursive algorithm
L2 7
to perform binary search on list of elements
b Develop a recursive algorithm to find the minimum and maximum element
L3 7
from the list. Illustrate with an example.
c Apply Quick sort on the following set of elements:
L3 6
60, 70, 75, 80, 85, 60, 55, 50, 45
OR
Q.04 a Apply Source removal method to obtain Topological sort for the Given
Graph:

L3 6

b Write an algorithm to sort N numbers by applying Merge sort. L3 7


c Apply Strassen’s Matrix Multiplication method to multiply the given two
matrices. Discuss how this method is better than general matrix
multiplication method L3 7

Page 01 of 02
18CS42
Module-3
Q. 05 a Apply Greedy method to obtain an optimal solution to the Knapsack
problem where Knapsack capacity m=15.
Object 1 2 3 4 5 6 7 L3 7
Weight 10 5 15 7 6 8 3
Profit 2 3 5 7 1 4 1

b What is Job sequencing with deadlines problem? For the given data, find
the optimal job sequence and maximum profit using Greedy approach.
Jobs J1 J2 J3 J4 J5 L2 6
Profits 60 100 20 40 20
Deadlines 2 2 3 1 1

c Apply Prim’s algorithm to obtain the minimum cost spanning tree for the
given weighted graph.

L3 7

OR
Q. 06 a Design Dijkstra’s algorithm and apply the same to find single source
shortest path for the given graph by considering ‘S’ as the source vertex

L3 8

b Construct the Huffman tree for the following data


Character A B C D E -
Probability 0.5 0.35 0.5 0.1 0.4 0.2 L3 5

Encode: a] BED b] AB_CD


c
Define Heap. Sort the given list of Elements using heap sort: 2, 9, 7, 6, 5, 8 L3 8
Module-4
Q. 07 a Explain Multistage graphs with example. Write multistage graph algorithm
L2 6
using forward approach.
b Write Warshall’s algorithm to compute transitive closure of a directed
graph. Apply the same on the graph defined by the following adjacency
matrix:

L3 8

c Construct an optimal binary search tree for the following four–key set
Key A B C D L3 6
Probability 0.1 0.2 0.4 0.3

Page 02 of 02
18CS42
OR
Q. 08 a Apply Floyd’s algorithm to find all pair shortest path for the given graph

L3 7

b Find the optimal tour for sales person using dynamic programming
technique for the given graph and its corresponding edge length matrix

L3 7

c Find the shortest path from node 1 to every other node in the given graph
using Bellman-Ford algorithm

L3 6

Module-5
Q. 09 a What is the central principle of backtracking? Apply backtracking to solve
the below instance of sum of subset problem S = {5, 10, 12, 13, 15, 18} L3 7
d = 30.
b Solve the below instance of assignment problem using branch and bound
algorithm

L3 7

c What is Hamiltonian circuit problem? What is the procedure to find


L2 6
Hamiltonian circuit of a graph?
OR
Q. 10 a Illustrate N Queen’s Problem using Back tracking to solve 4 Queen’s
L3 8
problem
b Explain the following: a] LC Branch and bound b] FIFO Branch and bound L2 6
c Explain the classes of NP-Hard and NP-Complete problems L2 6

Page 03 of 03
18CS42

Model Question Paper-1 with effect from 2019-20 (CBCS Scheme)

USN :

Fourth Semester B.E. Degree Examination

Design and Analysis of Algorithms


Time: 03 Hrs Max. Marks:100

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. Explain the advantages of optimal binary search tree. (04 Marks)


Module - 5
9 a. Solve the given instance of sum of subset problem s={3,5,6,7} and d=15. Construct a state
space tree. (08 Marks)
b. With the help of a state space tree. Solve the Travelling Salesman Problem for the following
graph using branch and bound concept. (08Marks)

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)

You might also like