Greedy-algorithm

Level: Beginner

1. Activity Selection Problem: Given the start and end times of activities, find the maximum number of activities that can be performed without overlapping.
2. Fractional Knapsack Problem: Given weights and values of items, determine the maximum value that can be obtained by placing fractional amounts of items in a knapsack of capacity W.
3. Job Sequencing Problem: Given jobs with deadlines and profits, find the sequence of jobs that maximizes total profit.
4. Minimum Platforms: Given arrival and departure times of trains, find the minimum number of platforms needed at the station.
5. Find Minimum Number of Coins: Given a value, find the minimum number of coins needed to make that value using given denominations.
6. Maximum Sum Subarray: Given an array, find the contiguous subarray with the largest sum.
7. Largest Number Formation: Given an array of numbers, arrange them to form the largest possible number.
8. Can Place Flowers: Given a flowerbed, determine if you can place a given number of new flowers without violating the no-adjacent-flowers rule.
9. Maximize Toys with Given Budget: Given an array of toy prices and a budget, find the maximum number of toys you can buy.
10. Greedy Activity Selection: Select the maximum number of activities that do not overlap, given start and finish times.
11. Minimum Cost to Cut a Board: Given a board of length n, find the minimum cost to cut it into pieces of length 1.
12. Maximize Tip Amount: Given orders with tips, maximize the total tip amount by assigning orders to waiters.
13. Largest Sum Contiguous Subarray: Find the contiguous subarray with the largest sum in an array.
14. Minimum Number of Arrows to Burst Balloons: Given intervals representing balloons, find the minimum number of arrows needed to burst all balloons.
15. Rearrange Characters to Avoid Repetition: Rearrange the characters of a string so that no two adjacent characters are the same.
16. Maximize Array Sum After K Negations: Given an array, maximize the sum after at most K negations of its elements.
17. Longest Common Subsequence: Given two strings, find the longest subsequence that is common to both strings.
18. Minimize the Sum of Product: Given two arrays, find the minimum sum of products of their elements by reordering the arrays.
19. Maximize Sum of Pairs with Difference: Given an array, find the maximum sum of pairs with a specific difference.
20. Minimum Cost to Connect Sticks: Given lengths of sticks, find the minimum cost to connect them into one stick.
21. Job Scheduling with Deadlines: Given jobs with deadlines and profits, find the maximum profit sequence of jobs.
22. Minimize the Difference Between Maximum and Minimum: Given an array and an integer k, find the minimum difference between the maximum and minimum values after modifying the array elements by at most k.
23. Maximize Profit with K Transactions: Given stock prices, find the maximum profit with at most k transactions.
24. Meeting Rooms: Given a list of meeting time intervals, determine if a person can attend all meetings.
25. Interval Scheduling Maximization: Select the maximum number of non-overlapping intervals.
26. Partition Labels: Partition a string into as many parts as possible so that each letter appears in at most one part.
27. Minimize Deviation in Array: Given an array, find the minimum deviation by performing allowed operations.
28. Candy Distribution Problem: Distribute candies to children such that each child gets at least one candy, and the children with a higher rating get more candies than their neighbors.
29. Buy and Sell Stock: Given stock prices, find the maximum profit from one buy-sell transaction.
30. Greedy Selection Problem: Given a set of activities with start and end times, select the maximum number of activities.

Intermediate Level: View

Advanced Level: View