chapter

    Greedy Method Pyqs for Cmi M.sc. and Ph.d. Computer Science

    Solve 0+ Greedy Method previous year questions for CMI M.Sc. and Ph.D. Computer Science with answers and detailed solutions. Free sample questions below.

    Free preview ends here

    Login to view the complete previous-year questions and solutions

    Creating an account is free. You get the rest of this chapter, step-by-step solutions, and a study plan built around the topics you are actually weak at.

    Explore complete test series, official past papers, and chapter-wise study tools.

    Why MastersUp

    Personalised first. High quality throughout.

    Most platforms hand everyone the same content. Here the content moves with your performance, topic by topic.

    Built around you, not around a syllabus PDF

    Every answer you give moves your topic-level intelligence rate. The next question, the next revision card and tomorrow's plan all change with it.

    Revision that hits your weak spots

    We only revise topics you have actually attempted and are still below the safe bar on — never the same chapter on repeat.

    Questions calibrated to the real exam

    Each question carries a measured toughness. You are served a rung above your current level, so practice keeps stretching you.

    Notes written for recall, not for volume

    Full lesson cards for first study, curated short-note cards for the last mile — with derivations, traps and exam patterns marked.

    One place for everything

    Notes, chapter practice, previous-year questions, test series and full-length papers — all feeding one picture of your preparation.

    Honest progress

    No vanity streaks. Progress here means chapters mastered and accuracy that held up on harder questions.

    Unlock the whole course

    Full notes and short notes, the complete question bank with worked solutions, mock tests, full-length papers, and an adaptive plan that rebuilds itself as you improve.

    Greedy Method PYQs for CMI M.Sc. and Ph.D. Computer Science

    Solve 0+ Greedy Method previous year questions for CMI M.Sc. and Ph.D. Computer Science with answers and detailed solutions. Free sample questions below.

    What makes a choice greedy and safe

    Intuition

    What makes a choice greedy and safe

    Imagine picking the heaviest apple first from a basket to maximize total weight.

    The problem it solves

    You never regret this first pick. This analogy stops being valid when picking the heaviest apple prevents you from picking two lighter apples that together weigh more.

    The idea made exact

    The greedy choice property holds for an optimization problem if there exists at least one globally optimal solution containing the locally optimal choice.

    S is feasible solutions g is greedy choice

    Proving the greedy choice property holds

    Derivation

    Proving the greedy choice property holds

    We must prove an optimal subset contains the greedy choice 7. Assume an optimal subset from exists where . We construct a new subset by modifying .

    Exchange Argument
    1. Find an element such that replacing with 7 keeps the subset valid. Feasibility check
    2. Define . Construction
    3. The objective value changes according to the equation: Linearity of sum
    4. The greedy rule ensures . Definition of greedy
    5. Therefore . Since was optimal, must also be optimal. Optimality preservation
    6. We have constructed an optimal subset containing 7. Conclusion
    Result
    Check

    If 7 was already in , the swap is the identity operation and the proof holds without modification.

    More previous year questions (pyqs) in this unit