Skip to content

// 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.

Questions

16

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16

Has an official figure

Work through the questions

16 questions

No verified answers are available for this paper.

  1. Question 1

    Part ADescriptive2 marks

    Algorithms

    State how the running time of an algorithm is measured.

    No verified answer or solution is available for this question.

  2. Question 2

    Part ADescriptive2 marks

    Algorithms

    Outline the significance of performing worst case analysis of an algorithm.

    No verified answer or solution is available for this question.

  3. Question 3

    Part ADescriptive2 marks

    Algorithms

    List the data structures that are used for representing graphs.

    No verified answer or solution is available for this question.

  4. Question 4

    Part ADescriptive2 marks

    Algorithms

    What is a strongly connected graph? Give an example.

    No verified answer or solution is available for this question.

  5. Question 5

    Part ADescriptive2 marks

    Algorithms

    What kinds of problems are solved using divide and conquer approach?

    No verified answer or solution is available for this question.

  6. Question 6

    Part ADescriptive2 marks

    Algorithms

    State the elements of greedy approach.

    No verified answer or solution is available for this question.

  7. Question 7

    Part ADescriptive2 marks

    Algorithms

    With an example, define Hamiltonian circuit.

    No verified answer or solution is available for this question.

  8. Question 8

    Part ADescriptive2 marks

    Algorithms

    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.

  9. Question 9

    Part ADescriptive2 marks

    Algorithms

    State the difference between tractable and non-tractable problems.

    No verified answer or solution is available for this question.

  10. Question 10

    Part ADescriptive2 marks

    Algorithms

    When is a problem said to be NP- hard? Give an example.

    No verified answer or solution is available for this question.

  11. Question 11

    Part BDescriptive13 marks

    Algorithms

    (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.

  12. Question 12

    Part BDescriptive13 marks

    Algorithms

    (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)

    Official figure for question 12, figure 1 of 4
    Figure 12(a)(i) - the graph for BFS and DFS.
    Official figure for question 12, figure 2 of 4
    Figure 12(a)(ii) - the graph for the minimum spanning tree.
    Official figure for question 12, figure 3 of 4
    Figure 12(b)(i) - the graph for the shortest paths.
    Official figure for question 12, figure 4 of 4
    Figure 12(b)(ii) - the network for Ford-Fulkerson.

    No verified answer or solution is available for this question.

  13. Question 13

    Part BDescriptive13 marks

    Algorithms

    (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.

  14. Question 14

    Part BDescriptive13 marks

    Algorithms

    (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.

  15. Question 15

    Part BDescriptive13 marks

    Algorithms

    (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.

  16. Question 16

    Part CDescriptive15 marks

    Algorithms

    (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)

    Official figure for question 16
    Figure 16(b)(i) - the directed graph for Bellman-Ford.

    No verified answer or solution is available for this question.

Keep preparing

Revisit another year or explore a different paper in the library.

More from this exam