Design & Analysis of Algorithms

105402
Back to Design & Analysis of Algorithms

Module 3: Greedy, Dynamic Programming and Other Paradigms

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

    The fractional Knapsack problem can be solved by using:

    • (i) Greedy method
    • (ii) Divide and conquer method
    • (iii) Dynamic programming
    • (iv) None of these
    View this question on its own page →
  2. 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

    Time complexity of Kadane's Algorithm is:

    • (i) O(n)O(n)
    • (ii) O(n2)O(n^2)
    • (iii) O(nlogn)O(n \log n)
    • (iv) O(n(logn)2)O(n(\log n)^2)
    View this question on its own page →
  3. 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

    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
    View this question on its own page →
  4. 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

    Approach of dynamic programming is similar to:

    • (i) parsing
    • (ii) hash table
    • (iii) divide and conquer algorithm
    • (iv) greedy algorithm
    View this question on its own page →
  5. 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

    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
    View this question on its own page →
  6. 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

    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
    View this question on its own page →
  7. 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

    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
    View this question on its own page →
  8. 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

    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
    View this question on its own page →
  9. 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

    State the general Knapsack problem. Write a greedy algorithm for this problem and derive its time complexity.

    View this question on its own page →
  10. 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. ![Graph for Prim's Algorithm](https://res.cloudinary.com/djkpavwmp/image/upload/v1765793015/portfolio_assets/ishk4eslrr0eggrzftvf.png)202214m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    What do you mean by optimal solution in greedy approach? Define the properties and function of greedy approach. Consider the graph G=(V,E)G=(V, E) given below. Find the minimum spanning tree by Prim's algorithms.

    Graph for Prim's Algorithm

    View this question on its own page →
  11. 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

    Find the minimum number of operations required for the following matrix chain multiplication using dynamic programming: A(10×20)B(20×50)C(50×1)D(1×100)A(10 \times 20) * B(20 \times 50) * C(50 \times 1) * D(1 \times 100)

    View this question on its own page →
  12. Q5a. State Huffman Tree. Explain with examples.20247m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    State Huffman Tree. Explain with examples.

    View this question on its own page →
  13. Q5b. Write Knuth-Morris-Pratt (KMP) algorithm for string matching problem.20237m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Write Knuth-Morris-Pratt (KMP) algorithm for string matching problem.

    View this question on its own page →
  14. 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

    Compare the various programming paradigms such as divide-and-conquer, dynamic programming and greedy approach.

    View this question on its own page →
  15. 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

    Find the optimal way to multiply the following matrices to perform the fewest multiplications:

    Matrix Dimension
    A1A_1 5×115 \times 11
    A2A_2 11×411 \times 4
    A3A_3 4×154 \times 15
    A4A_4 15×2315 \times 23
    View this question on its own page →
  16. 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

    Write an algorithm to find a minimum spanning tree (MST) for an undirected graph. Estimate the time complexity of your algorithm.

    View this question on its own page →
  17. 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

    How 8-Queen's problem can be solved using back tracking and explain with an example.

    View this question on its own page →
  18. 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

    Using greedy strategy, schedule the following jobs within deadline so as to maximize the profit.

    Job ii 1 2 3 4
    Deadline dd 3 2 3 1
    Profit gg 9 7 7 2
    View this question on its own page →
  19. Q6b. Distinguish greedy method and dynamic programming20247m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Distinguish greedy method and dynamic programming

    View this question on its own page →
  20. 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. ![Graph for Q7](https://res.cloudinary.com/djkpavwmp/image/upload/v1765793825/portfolio_assets/unbsmpjkz87ram7icew7.png)201914m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    What do you mean by optimal solution in greedy approach? Define the properties and function of greedy approach. Consider the graph G=(V,E)G = (V, E) given below. Find the minimum spanning tree by Prim's algorithms.

    Graph for Q7

    View this question on its own page →
  21. 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

    Write an algorithm for nn-queen's problem, find its time complexity and explain the algorithm using an example.

    View this question on its own page →
  22. Q7a. Construct minimum cost spanning tree using Kruskal's algorithm ![img](https://res.cloudinary.com/djkpavwmp/image/upload/v1765716963/portfolio_assets/g9uas5jujfngdp0lu5k1.png)20247m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Construct minimum cost spanning tree using Kruskal's algorithm
    img

    View this question on its own page →
  23. Q7b. Define spanning tree and minimum spanning tree20247m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Define spanning tree and minimum spanning tree

    View this question on its own page →
  24. 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

    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.

    View this question on its own page →
  25. Q8b. Explain Knapsack Problem.20247m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Explain Knapsack Problem.

    View this question on its own page →
  26. Q9a. Write short notes on: Kruskal algorithms.20197m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Write short notes on: Kruskal algorithms.

    View this question on its own page →
  27. Q9c. Write short notes on: Travelling Salesman Problem20247m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Write short notes on: Travelling Salesman Problem

    View this question on its own page →
  28. Q9d. Write short notes on: Divide-and-Conquer vs Dynamic programming20237m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Write short notes on: Divide-and-Conquer vs Dynamic programming

    View this question on its own page →
  29. Q9d. Write short notes on: Divide-N-Conquer vs Dynamic Programming20197m

    Module 3: Greedy, Dynamic Programming and Other Paradigms

    Write short notes on: Divide-N-Conquer vs Dynamic Programming

    View this question on its own page →