Design & Analysis of Algorithms
105402Module 3: Greedy, Dynamic Programming and Other Paradigms
Q1a. The fractional Knapsack problem can be solved by using: - (i) Greedy method - (ii) Divide and conquer method - (iii) Dynamic programming - (iv) None of these20232m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →The fractional Knapsack problem can be solved by using:
- (i) Greedy method
- (ii) Divide and conquer method
- (iii) Dynamic programming
- (iv) None of these
Q1b. Time complexity of Kadane's Algorithm is: - (i) O(n) - (ii) O(n^2) - (iii) O(n \log n) - (iv) O(n(\log n)^2)20192m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Time complexity of Kadane's Algorithm is:
- (i)
- (ii)
- (iii)
- (iv)
Q1e. An all-pairs shortest-paths problem is efficiently solved using: - (i) Dijkstra's algorithm - (ii) Bellman-Ford algorithm - (iii) Kruskal algorithm - (iv) Floyd-Warshall algorithm20192m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →An all-pairs shortest-paths problem is efficiently solved using:
- (i) Dijkstra's algorithm
- (ii) Bellman-Ford algorithm
- (iii) Kruskal algorithm
- (iv) Floyd-Warshall algorithm
Q1f. Approach of dynamic programming is similar to: - (i) parsing - (ii) hash table - (iii) divide and conquer algorithm - (iv) greedy algorithm20222m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Approach of dynamic programming is similar to:
- (i) parsing
- (ii) hash table
- (iii) divide and conquer algorithm
- (iv) greedy algorithm
Q1g. Which of the following is true about Huffman Coding? - (i) Huffman coding may become lossy in some cases. - (ii) Huffman codes may not be optimal lossless codes in some cases. - (iii) In Huffman coding, no code is prefix of any other code. - (iv) All of the above20192m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Which of the following is true about Huffman Coding?
- (i) Huffman coding may become lossy in some cases.
- (ii) Huffman codes may not be optimal lossless codes in some cases.
- (iii) In Huffman coding, no code is prefix of any other code.
- (iv) All of the above
Q1i. Which of the following standard algorithms is not a greedy algorithm? - (i) Dijkstra's shortest path algorithm - (ii) Kruskal algorithm - (iii) Bellman ford shortest path algorithm - (iv) Prim's algorithm20232m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Which of the following standard algorithms is not a greedy algorithm?
- (i) Dijkstra's shortest path algorithm
- (ii) Kruskal algorithm
- (iii) Bellman ford shortest path algorithm
- (iv) Prim's algorithm
Q1j. Kruskal's Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a? - (i) DP Problem - (ii) Greedy Algorithm - (iii) Adhoc Problem - (iv) None of the above20242m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Kruskal's Algorithm for finding the Minimum Spanning Tree of a graph is a kind of a?
- (i) DP Problem
- (ii) Greedy Algorithm
- (iii) Adhoc Problem
- (iv) None of the above
Q3a. Construct the Huffman coding tree for the text of characters with given frequencies. | Character | T | I | V | K | L | E | O | Z | P | R | |----------:|:--:|:--:|:--:|:-:|:--:|:--:|:--:|:--:|:--:|:--:| | Frequency | 43 | 38 | 16 | 8 | 56 | 12 | 41 | 13 | 22 | 6 |20237m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Construct the Huffman coding tree for the text of characters with given frequencies.
Character T I V K L E O Z P R Frequency 43 38 16 8 56 12 41 13 22 6 Q3b. State the general Knapsack problem. Write a greedy algorithm for this problem and derive its time complexity.20237m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →State the general Knapsack problem. Write a greedy algorithm for this problem and derive its time complexity.
Q5. What do you mean by optimal solution in greedy approach? Define the properties and function of greedy approach. Consider the graph G=(V, E) given below. Find the minimum spanning tree by Prim's algorithms. 202214m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →What do you mean by optimal solution in greedy approach? Define the properties and function of greedy approach. Consider the graph given below. Find the minimum spanning tree by Prim's algorithms.

Q5a. Find the minimum number of operations required for the following matrix chain multiplication using dynamic programming: A(10 \times 20) * B(20 \times 50) * C(50 \times 1) * D(1 \times 100)20237m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Find the minimum number of operations required for the following matrix chain multiplication using dynamic programming:
Q5a. State Huffman Tree. Explain with examples.20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →State Huffman Tree. Explain with examples.
Q5b. Write Knuth-Morris-Pratt (KMP) algorithm for string matching problem.20237m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write Knuth-Morris-Pratt (KMP) algorithm for string matching problem.
Q5b. Compare the various programming paradigms such as divide-and-conquer, dynamic programming and greedy approach.20197m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Compare the various programming paradigms such as divide-and-conquer, dynamic programming and greedy approach.
Q6. Find the optimal way to multiply the following matrices to perform the fewest multiplications: | Matrix | Dimension | | :--- | :--- | | A_1 | 5 \times 11 | | A_2 | 11 \times 4 | | A_3 | 4 \times 15 | | A_4 | 15 \times 23 |202214m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Find the optimal way to multiply the following matrices to perform the fewest multiplications:
Matrix Dimension Q6a. Write an algorithm to find a minimum spanning tree (MST) for an undirected graph. Estimate the time complexity of your algorithm.20238m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write an algorithm to find a minimum spanning tree (MST) for an undirected graph. Estimate the time complexity of your algorithm.
Q6a. How 8-Queen's problem can be solved using back tracking and explain with an example.20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →How 8-Queen's problem can be solved using back tracking and explain with an example.
Q6b. Using greedy strategy, schedule the following jobs within deadline so as to maximize the profit. | Job i | 1 | 2 | 3 | 4 | | :--- | :--- | :--- | :--- | :--- | | Deadline d | 3 | 2 | 3 | 1 | | Profit g | 9 | 7 | 7 | 2 |20236m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Using greedy strategy, schedule the following jobs within deadline so as to maximize the profit.
Job 1 2 3 4 Deadline 3 2 3 1 Profit 9 7 7 2 Q6b. Distinguish greedy method and dynamic programming20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Distinguish greedy method and dynamic programming
Q7. What do you mean by optimal solution in greedy approach? Define the properties and function of greedy approach. Consider the graph G = (V, E) given below. Find the minimum spanning tree by Prim's algorithms. 201914m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →What do you mean by optimal solution in greedy approach? Define the properties and function of greedy approach. Consider the graph given below. Find the minimum spanning tree by Prim's algorithms.

Q7a. Write an algorithm for n-queen's problem, find its time complexity and explain the algorithm using an example.20237m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write an algorithm for -queen's problem, find its time complexity and explain the algorithm using an example.
Q7a. Construct minimum cost spanning tree using Kruskal's algorithm 20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Construct minimum cost spanning tree using Kruskal's algorithm

Q7b. Define spanning tree and minimum spanning tree20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Define spanning tree and minimum spanning tree
Q8. What is activity selection problem? Suppose that instead of always selecting the first activity to finish, we select the last activity to start that is compatible with all previously selected activities. Describe how this approach is a greedy algorithm, prove that it yields an optimal solution.202214m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →What is activity selection problem? Suppose that instead of always selecting the first activity to finish, we select the last activity to start that is compatible with all previously selected activities. Describe how this approach is a greedy algorithm, prove that it yields an optimal solution.
Q8b. Explain Knapsack Problem.20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Explain Knapsack Problem.
Q9a. Write short notes on: Kruskal algorithms.20197m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write short notes on: Kruskal algorithms.
Q9c. Write short notes on: Travelling Salesman Problem20247m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write short notes on: Travelling Salesman Problem
Q9d. Write short notes on: Divide-and-Conquer vs Dynamic programming20237m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write short notes on: Divide-and-Conquer vs Dynamic programming
Q9d. Write short notes on: Divide-N-Conquer vs Dynamic Programming20197m
Module 3: Greedy, Dynamic Programming and Other Paradigms
View this question on its own page →Write short notes on: Divide-N-Conquer vs Dynamic Programming