Question Paper Code : 20012
B.E./B.Tech. DEGREE EXAMINATIONS, NOVEMBER/DECEMBER 2023.
Third Semester
Artificial Intelligence and Data Science
AD 3351 — DESIGN AND ANALYSIS OF ALGORITHMS
(Common to : Computer Science and Business Systems)
(Regulations 2021)
Answer ALL questions.
PART A — (10 × 2 = 20 marks)
- 1.
Define algorithm.
- 2.
Distinguish sequential and parallel algorithms.
- 3.
What is brute force approach?
- 4.
List the major variations of decrease-and-conquer technique.
- 5.
Define principle of optimality.
- 6.
Write the pseudo code of Floyd's algorithm.
- 7.
List the requirements of standard form.
- 8.
Infer when a pair (m, w) is said to be a blocking pair.
- 9.
Write about information-theoretic lower bound.
- 10.
State Heuristic with an example.
PART B — (5 × 13 = 65 marks)
- 11.(a)
- (i)Write the pseudocode for Euclid's algorithm.(5)
- (ii)Describe graph problems and combinatorial problems in detail.(8)
- Or
- (b)
- (i)Indicate the steps for analyzing the efficiency of the algorithm with examples.(8)
- (ii)Infer how asymptotic notations are used to express the complexity of an algorithm.(5)
- 12.(a)
- (i)Reproduce an algorithm to implement brute-force string matching problem with an example and specify its worst case, average-case complexity.(5)
- (ii)Describe Traveling sales person problem using exhaustive search technique and find the optimal tour for the following graph. [Figure: undirected graph with vertices a, b, c, d and edges a-b = 2, a-c = 5, a-d = 7, b-c = 8, b-d = 3, c-d = 1](8)
- Or
- (b)
- (i)State the strategy of divide and conquer technique to compute the product of two n * n matrices using Strassen's method.(5)
- (ii)Draw step by step successive key insertions for the list 2, 9, 7, 6, 5, 8 by bottom-up heap. Construct an algorithm for the same and specify its complexity.(8)
- 13.(a)
- (i)Discuss how coin changing problem can be solved by dynamic programming with an example.(6)
- (ii)Indicate the algorithm to find the optimal feasible subset of first i entries by memory function for the knapsack problem.(7)
- Or
- (b)
- (i)Write Dijkstra's algorithm to find the shortest path for the following graph using greedy technique. [Figure: directed graph with vertices 1 to 6 and edges 1->2 = 50, 1->3 = 45, 1->4 = 10, 2->3 = 10, 2->4 = 15, 3->5 = 30, 4->1 = 20, 4->5 = 15, 5->2 = 20, 5->3 = 35, 6->5 = 3](7)
- (ii)Explain how Huffman trees are constructed for assigning shorter bit strings to high-frequency symbols and longer ones to low-frequency symbols.(6)
- 14.(a)
- (i)List the steps of the simplex method.(5)
- (ii)State the shortest-augmenting-path algorithm to find a maximum flow and a minimum cut in the networks.(8)
- Or
- (b)
- (i)Outline the pseudo code for Maximum Matching Bipartite graph.(8)
- (ii)Describe how you will find a stable marriage matching for men's and women's preferences.(5)
- 15.(a)
- (i)Summerize P, NP and NP-Complete problems.(6)
- (ii)Discuss how N-Queen's problem can be solved by back tracking technique.(7)
- Or
- (b)
- (i)Describe Traveling sales person problem using Branch and Bound technique with an example.(7)
- (ii)Infer the steps of greedy algorithm for discrete and continuous knapsack problem with an example.(6)
PART C — (1 × 15 = 15 marks)
- 16.(a)
- (i)Devise an algorithm for the multistage graph problem using dynamic programming design technique.(10)
- (ii)Compute the minimum cost and path from s to t for the following multistage graph. [Figure: five-stage graph, K = 1: vertex 1 (S); K = 2: vertices 2, 3; K = 3: vertices 4, 5, 6; K = 4: vertices 7, 8; K = 5: vertex 9 (T). Edges: 1-2 = 5, 1-3 = 2, 2-4 = 3, 2-6 = 3, 3-4 = 6, 3-5 = 5, 3-6 = 8, 4-7 = 1, 4-8 = 4, 5-7 = 6, 5-8 = 2, 6-7 = 6, 6-8 = 2, 7-9 = 7, 8-9 = 3](5)
- Or
- (b)
- (i)Justify how backtracking technique is used to solve sum of subsets problem with its pseudo code and complexity.(10)
- (ii)Construct all possible subsets of weights that sum to M for the given instance n = 6. M = 30 and Weights (1:6) = (5, 10, 12, 13, 15, 18).(5)