2022 question paper
Design and Analysis of Algorithms
25 questions
Q1a. An adjacency matrix representation of a graph cannot contain information of (i) nodes (ii) edges (iii) direction of edges (iv) parallel edges20222m
Module 3: Graph and Tree Algorithms
View this question on its own page →An adjacency matrix representation of a graph cannot contain information of
(i) nodes
(ii) edges
(iii) direction of edges
(iv) parallel edgesQ1b. An algorithm is made up of two independent time complexities f(n) and g(n). Then the complexities of the algorithm is in the order of (i) f(n) \times g(n) (ii) \max \{ f(n), g(n) \} (iii) \min \{ f(n), g(n) \} (iv) f(n) + g(n)20222m
Module 1: Introduction
View this question on its own page →An algorithm is made up of two independent time complexities and . Then the complexities of the algorithm is in the order of
(i)
(ii)
(iii)
(iv)Q1c. The minimum number of colors needed to color a graph having n > 3 vertices and 2 edges is (i) 2 (ii) 3 (iii) 4 (iv) 120222m
Module 3: Graph and Tree Algorithms
View this question on its own page →The minimum number of colors needed to color a graph having vertices and 2 edges is
(i) 2
(ii) 3
(iii) 4
(iv) 1Q1d. BFS on a graph G = (V, E) has running time (i) O(|V| + |E|) (ii) O(|V|) (iii) O(|E|) (iv) None of these20222m
Module 3: Graph and Tree Algorithms
View this question on its own page →BFS on a graph has running time
(i)
(ii)
(iii)
(iv) None of theseQ1e. Which one is true of the following (i) all NP hard problems are NP complete (ii) all NP complete problems are NP hard (iii) some NP complete problems are NP hard (iv) None of these20222m
Module 4: Tractable and Intractable Problems
View this question on its own page →Which one is true of the following
(i) all NP hard problems are NP complete
(ii) all NP complete problems are NP hard
(iii) some NP complete problems are NP hard
(iv) None of theseQ1f. Which one of the following functions is asymptotically smallest? (i) 2^n (ii) n^{\log n} (iii) n^{\sqrt{n}} (iv) (100)^{(\log n)^{1/3}} + (\log \log n)^{2/3}20222m
Module 1: Introduction
View this question on its own page →Which one of the following functions is asymptotically smallest?
(i)
(ii)
(iii)
(iv)Q1g. Which of the following algorithm solves the All Pair Shortest Path problem (i) Dijkstra's (ii) Floyd's Warshall's (iii) Prim's (iv) Kruskal's20222m
Module 3: Graph and Tree Algorithms
View this question on its own page →Which of the following algorithm solves the All Pair Shortest Path problem
(i) Dijkstra's
(ii) Floyd's Warshall's
(iii) Prim's
(iv) Kruskal'sQ1h. The average number of comparisons performed by merge sort algorithm in merging two sorted lists of 2 elements is (i) 8/5 (ii) 11/7 (iii) 11/6 (iv) 8/320222m
Module 1: Introduction
View this question on its own page →The average number of comparisons performed by merge sort algorithm in merging two sorted lists of 2 elements is
(i) 8/5
(ii) 11/7
(iii) 11/6
(iv) 8/3Q1i. Which one of the following statement is correct? (i) If A \le_p B and B \in P then A \in P (ii) If A \le_p B and $A otin P then B otin P$ (iii) If A \le_p B and B \le_p C then A \le_p C (iv) All of these20222m
Module 4: Tractable and Intractable Problems
View this question on its own page →Which one of the following statement is correct?
(i) If and then
(ii) If and $A
otin PB
otin P$
(iii) If and then
(iv) All of theseQ1j. Kruskal algorithm is a (i) Divide & conquer algorithm (ii) Branch and bound algorithm (iii) Greedy algorithm (iv) Dynamic programming20222m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Kruskal algorithm is a
(i) Divide & conquer algorithm
(ii) Branch and bound algorithm
(iii) Greedy algorithm
(iv) Dynamic programmingQ2a. Solve the following recurrence by successive substitution method: f(1) = 1 \quad \text{if } n=1 f(n) = 3f(n/2) + 6 \quad \text{if } n > 120227m
Module 1: Introduction
View this question on its own page →Solve the following recurrence by successive substitution method:
Q2b. Write the Knuth-Morris-Pratt algorithm for pattern matching. Apply the KMP algorithm for the pattern p = "ababaca" and string s = "bacbabababacaab". Show every step.20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Write the Knuth-Morris-Pratt algorithm for pattern matching. Apply the KMP algorithm for the pattern and string . Show every step.
Q3a. Give step by step procedure to find minimal spanning tree for the given graph. 20227m
Module 3: Graph and Tree Algorithms
View this question on its own page →Give step by step procedure to find minimal spanning tree for the given graph.
Q3b. Write the algorithm for quick sort. Find the best-case, worst-case and average-case time complexities of this algorithm.20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Write the algorithm for quick sort. Find the best-case, worst-case and average-case time complexities of this algorithm.
Q4a. Solve the single source shortest path problem for the following graph considering '1' as the source vertex using Dijkstra's algorithm. 20227m
Module 3: Graph and Tree Algorithms
View this question on its own page →Solve the single source shortest path problem for the following graph considering '1' as the source vertex using Dijkstra's algorithm.
Q4b. State the graph coloring problem and write the algorithm. Apply backtracking technique to solve the 3-colouring problem for the following graph. 20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →State the graph coloring problem and write the algorithm. Apply backtracking technique to solve the 3-colouring problem for the following graph.
Q5a. Differentiate between divide & conquer, greedy method and dynamic programming with suitable examples.20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Differentiate between divide & conquer, greedy method and dynamic programming with suitable examples.
Q5b. Find the minimum number of operations required for the following matrix chain multiplication using dynamic programming. Also discuss the complexity involved. A(10 \times 20) * B(20 \times 50) * C(50 \times 1) * D(1 \times 100)20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Find the minimum number of operations required for the following matrix chain multiplication using dynamic programming. Also discuss the complexity involved.
Q6a. Explain solution pseudocode for N-Queens problem using backtracking.20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Explain solution pseudocode for N-Queens problem using backtracking.
Q6b. Find Huffman codes for the text of characters with given frequencies: | Characters | T | I | V | K | L | E | O | Z | P | R | |---|---|---|---|---|---|---|---|---|---|---| | Frequencies | 43 | 38 | 16 | 8 | 50 | 12 | 56 | 13 | 22 | 7 |20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Find Huffman codes for the text of characters with given frequencies:
Characters T I V K L E O Z P R Frequencies 43 38 16 8 50 12 56 13 22 7 Q7a. What is negative weight-cycle? Write Bellman-Ford algorithm to find single source shortest distance of a directed graph.20227m
Module 3: Graph and Tree Algorithms
View this question on its own page →What is negative weight-cycle? Write Bellman-Ford algorithm to find single source shortest distance of a directed graph.
Q7b. Define P-Class, NP-class, NP-complete class and NP-hard class of problems. What is the relation between them?20227m
Module 4: Tractable and Intractable Problems
View this question on its own page →Define P-Class, NP-class, NP-complete class and NP-hard class of problems. What is the relation between them?
Q8a. Find the optimal solution using greedy criteria for a knapsack having capacity 100 kg for the following list of items having values and weights as shown in the table. | Item | Value | Weight | |---|---|---| | I_1 | 10 | 15 | | I_2 | 20 | 25 | | I_3 | 30 | 35 | | I_4 | 40 | 45 | | I_5 | 50 | 55 |20227m
Module 2: Fundamental Algorithmic Strategies
View this question on its own page →Find the optimal solution using greedy criteria for a knapsack having capacity 100 kg for the following list of items having values and weights as shown in the table.
Item Value Weight 10 15 20 25 30 35 40 45 50 55 Q8b. State master's theorem and find the time complexity for the following recurrence: T(n) = 2T(n^{1/2}) + \log n20227m
Module 1: Introduction
View this question on its own page →State master's theorem and find the time complexity for the following recurrence:
Q9. Write short notes on any two of the following: (i) Asymptotic Notations (ii) Clique decision problem (iii) Max-flow-min-cut theorem (iv) Union-Find Algorithm202214m
Module 1: Introduction
View this question on its own page →Write short notes on any two of the following:
(i) Asymptotic Notations
(ii) Clique decision problem
(iii) Max-flow-min-cut theorem
(iv) Union-Find Algorithm