Notice: Due to an ongoing migration of our storage and publishing system, material requested since last month will not be uploaded for the time being, and new requests are paused. All existing notes remain available.

Unit 4 subjective questions Greedy techniques

CSE329 — Prelude To Competitive Coding 20 questions with model answers. Write yours first, then compare.

Read the notes Practice MCQs
  1. Question 1 of 20

    Define the greedy problem-solving paradigm. Explain its key characteristics and the general steps involved in designing a greedy algorithm.

  2. Question 2 of 20

    Distinguish between a locally optimal choice and a globally optimal choice in the context of greedy algorithms. Give an example where a locally optimal choice fails to give a globally optimal solution.

  3. Question 3 of 20

    Explain the Job Sequencing Problem with Deadlines. Describe the greedy strategy used to maximize profit and illustrate with an example.

  4. Question 4 of 20

    Describe the Activity Selection Problem. Prove why sorting by earliest finish time yields an optimal solution.

  5. Question 5 of 20

    Explain the Fractional Knapsack Problem and its greedy solution. How does it differ from the 0/1 Knapsack problem?

  6. Question 6 of 20

    Describe the Connect n Ropes with Minimum Cost problem. Explain the greedy approach and why a min-heap is used.

  7. Question 7 of 20

    Explain the Coin Change Problem using the greedy technique. Under what conditions does the greedy approach produce an optimal solution?

  8. Question 8 of 20

    Explain how to find the Maximum Product Subset of an array. Handle all cases including negative numbers, zeros, and single elements.

  9. Question 9 of 20

    Explain how to find the Minimum Product Subset of an array. Discuss the logic for handling negatives, positives, and zeros.

  10. Question 10 of 20

    Describe the problem of finding the Minimum Sum of Product of Two Arrays. Prove the greedy strategy used (Rearrangement Inequality).

  11. Question 11 of 20

    Explain the Bin Packing Problem. Describe common greedy heuristics used to solve it and comment on their approximation quality.

  12. Question 12 of 20

    Explain the Majority Element problem and describe the Boyer-Moore Voting Algorithm used to solve it efficiently.

  13. Question 13 of 20

    Compare the Greedy and Dynamic Programming approaches. When would you prefer one over the other?

  14. Question 14 of 20

    Given jobs with (deadline, profit): J1(4,70), J2(1,80), J3(1,30), J4(1,100), J5(3,50), solve the Job Sequencing Problem step by step and compute maximum profit.

  15. Question 15 of 20

    Explain the concept of optimal substructure and the greedy choice property. Why are both essential for a greedy algorithm to be correct?

  16. Question 16 of 20

    Differentiate between the Job Sequencing Problem and the Job Selection Problem (Activity Selection). Compare their objectives and greedy criteria.

  17. Question 17 of 20

    Solve the Fractional Knapsack problem for capacity with items: Item1(weight 6, value 30), Item2(weight 3, value 21), Item3(weight 5, value 40), Item4(weight 4, value 12). Show the value-to-weight ratios and total value.

  18. Question 18 of 20

    Describe the greedy solution for the Connect n Ropes problem and derive its relationship with Huffman Coding.

  19. Question 19 of 20

    Explain a greedy algorithm to solve the fractional coin/activity type problem, and discuss the limitations of greedy algorithms with two concrete examples where they fail.

  20. Question 20 of 20

    Explain how greedy techniques are applied in competitive coding. Discuss the general problem-solving strategy and how to recognize when a problem can be solved greedily.

That's unit 4

Long answers stick best when they're tested again soon. Run the MCQs on this unit, then come back to the questions you found hardest.