🧠 Week 2: Greedy Algorithms


📌 What is a Greedy Algorithm?

A greedy algorithm is a simple and efficient approach for solving optimization problems by making the locally optimal choice at each step with the hope that these choices will lead to a globally optimal solution.


✅ Key Characteristics


📖 Example Problem

You are given N tasks, and for each task, you know its duration in minutes.

You also have only M free minutes.

Goal: Finish as many tasks as possible.


❌ Brute Force Solution

Time Complexity: