Greedy Algorithm: Easy to Hard Problems
Easy
- Assign Cookies (Assigns cookies to children to maximize the number of satisfied children)
- Best Time to Buy and Sell Stock (Finds the best time to buy and sell stock for maximum profit)
- Gas Station (Finds the starting gas station that allows a complete circuit)
- Can Place Flowers (Determines if a flower can be planted in a garden with given constraints)
- Minimum Absolute Difference (Finds the minimum absolute difference between any two elements)
Medium
- Partition Labels (Partitions a string into as many parts as possible with unique characters)
- Non-overlapping Intervals (Finds the minimum number of intervals to remove so that no intervals overlap)
- Job Scheduling with Deadlines (Schedules jobs to maximize profit considering deadlines)
- Activity Selection Problem (Selects the maximum number of activities that don’t overlap)
- Interval Partitioning (Finds the minimum number of resources required to schedule all activities)
Hard
- Minimum Number of Arrows to Burst Balloons (Finds the minimum number of arrows required to burst all balloons)
- Optimal Account Balancing (Minimizes the number of transactions required to settle accounts)
- Reconstruct Itinerary (Reconstructs the itinerary from a list of tickets)
- Huffman Encoding (Creates an optimal prefix code for data compression using Huffman coding)
- Minimum Cost to Merge Stones (Finds the minimum cost to merge stones into a single pile)