// Anna University, Chennai / 2024
Anna University — Algorithms (CS3401), April/May 2024
Algorithms · CS3401 · R2021 · B.E. Computer Science and Engineering · Semester 4
Files open in a new tab. Use your browser's download or save option to keep a copy.
Work through the questions
16 questions
No verified answers are available for this paper.
State how the running time of an algorithm is measured.
No verified answer or solution is available for this question.
Outline the significance of performing worst case analysis of an algorithm.
No verified answer or solution is available for this question.
List the data structures that are used for representing graphs.
No verified answer or solution is available for this question.
What is a strongly connected graph? Give an example.
No verified answer or solution is available for this question.
What kinds of problems are solved using divide and conquer approach?
No verified answer or solution is available for this question.
State the elements of greedy approach.
No verified answer or solution is available for this question.
With an example, define Hamiltonian circuit.
No verified answer or solution is available for this question.
Why is branch and bound approach found to be appropriate for solving travelling salesman problem?
No verified answer or solution is available for this question.
State the difference between tractable and non-tractable problems.
No verified answer or solution is available for this question.
When is a problem said to be NP- hard? Give an example.
No verified answer or solution is available for this question.
(a) (i) Explain in detail about various asymptotic notations and it's properties. (8) (ii) Use substitution method to show that T(n) = 2T(n/2) + n is O(n log(n)). (5) (OR) (b) (i) With a suitable example, illustrate the time and space complexity analysis of binary search and linear search. (8) (ii) Explain the working of naïve string matching algorithm with ABCCDDAEFG as the text input and CDD as the search string. (5)
No verified answer or solution is available for this question.
(a) (i) Write the pseudocode for BFS and DFS traversals on the graph given below in fig. 12 (a) (i) and compare the time and space complexity of the two traversals. (7) (ii) Find the Minimum Spanning Tree of the following graph in fig. 12 (a) (ii) using Kruskal's algorithm. (6) (OR) (b) (i) Given a graph and a source vertex in the graph, find the shortest paths from the source vertex 0 to all vertices in the given graph 12 (b) (i). (8) (ii) Using Ford-Fulkerson algorithm find the maximum possible flow in the network given below Fig 12 (b) (ii). (5)

Figure 12(a)(i) - the graph for BFS and DFS. 
Figure 12(a)(ii) - the graph for the minimum spanning tree. 
Figure 12(b)(i) - the graph for the shortest paths. 
Figure 12(b)(ii) - the network for Ford-Fulkerson. No verified answer or solution is available for this question.
(a) (i) Demonstrate divide and conquer approach by Performing quick sort on the following values. (7) 44, 33, 11, 55, 77, 90, 40, 60, 99, 22, 88 (ii) Using Dynamic programming, Solve matrix chain multiplication problem. (6) (OR) (b) (i) Solve the following problem using Greedy algorithm. Given activities with their start and finish times, select the maximum number of activities that can be performed by a single person, assuming that a person can only work on a single activity at a time. (8) (ii) A character-coding problem. A data file of 100,000 characters contains only the characters a-f, with the frequencies indicated as below Frequency (in thousands) a 45 b 13 c 12 d 16 e 9 f 5 Show the steps in constructing the final Huffman tree representing the optimal prefix code. (5)
No verified answer or solution is available for this question.
(a) (i) Explain the steps in solving n-queens problem using backtracking approach. (5) (ii) Solve the following subset sum problem using back tracking. Let S = {3,7,9,13,26,41}; d(sum) = 51. (8) (OR) (b) (i) Discuss briefly about the general method of branch and Bound approach and state how it differs from backtracking. (8) (ii) Explain the branching mechanism in the Branch and Bound Strategy to solve 0/1 Knapsack problem. (5)
No verified answer or solution is available for this question.
(a) (i) Show that if an algorithm makes atmost a constant number of calls to polynomial time subroutines and performs an additional amount of work that also takes polynomial time, then it runs in polynomial time. (8) (ii) Show that the satisfiability of Boolean formulas in 3-conjunctive normal form (3- CNF) is NP-complete. (5) (OR) (b) (i) Illustrate polynomial-time approximation scheme for the sum of subsets problem. (7) (ii) Illustrate the working of Miller-Rabin randomized primality test. (6)
No verified answer or solution is available for this question.
(a) (i) How many spurious hits does the Rabin-Karp matcher encounter in the text T = 3141592653589793 when Working modulo q = 11 and looking for the pattern P = 26. Briefly write about the processing time, worst-case running time and average-case running time of Rabin-Karp algorithm. (10) (ii) With an example to show the best-case, worst-case and average case analysis of heap sort. (5) (OR) (b) (i) Run the Bellman-Ford algorithm on the directed graph of figure 16 (b) (i) below using vertex s as the source and show the results after each pass of an algorithm. (7) (ii) With an example, Show that the cardinality of a maximum matching M in a bipartite graph G equals the value of a maximum flow f in its corresponding flow network G'. (8)

Figure 16(b)(i) - the directed graph for Bellman-Ford. No verified answer or solution is available for this question.