35 Problems

Greedy

Master greedy problems with detailed brute force and optimal solutions.

01
Activity Selection Problem
Click to view brute force and optimal solutions
02
Job Sequencing Problem
Click to view brute force and optimal solutions
03
Huffman Coding
Click to view brute force and optimal solutions
04
Water Connection Problem
Click to view brute force and optimal solutions
05
Fractional Knapsack Problem
Click to view brute force and optimal solutions
06
Greedy Algorithm to find Minimum number of Coins
Click to view brute force and optimal solutions
07
Maximum trains for which stoppage can be provided
Click to view brute force and optimal solutions
08
Minimum Platforms Problem
Click to view brute force and optimal solutions
09
Buy Maximum Stocks if i stocks can be bought on i-th day
Click to view brute force and optimal solutions
10
Find the minimum and maximum amount to buy all N candies
Click to view brute force and optimal solutions
11
Minimize Cash Flow among a given set of friends who have borrowed money from each other
Click to view brute force and optimal solutions
12
Minimum Cost to cut a board into squares
Click to view brute force and optimal solutions
13
Check if it is possible to survive on Island
Click to view brute force and optimal solutions
14
Find maximum meetings in one room
Click to view brute force and optimal solutions
15
Maximum product subset of an array
Click to view brute force and optimal solutions
16
Maximize array sum after K negations
Click to view brute force and optimal solutions
17
Maximize the sum of arr[i] times i
Click to view brute force and optimal solutions
18
Maximum sum of absolute difference of an array
Click to view brute force and optimal solutions
19
Maximize sum of consecutive differences in a circular array
Click to view brute force and optimal solutions
20
Minimum sum of absolute difference of pairs of two arrays
Click to view brute force and optimal solutions
21
Program for Shortest Job First (or SJF) CPU Scheduling
Click to view brute force and optimal solutions
22
Program for Least Recently Used (LRU) Page Replacement algorithm
Click to view brute force and optimal solutions
23
Smallest subset with sum greater than all other elements
Click to view brute force and optimal solutions
24
Chocolate Distribution Problem
Click to view brute force and optimal solutions
25
DEFKIN - Defense of a Kingdom
Click to view brute force and optimal solutions
26
DIEHARD - DIE HARD
Click to view brute force and optimal solutions
27
GERGOVIA - Wine trading in Gergovia
Click to view brute force and optimal solutions
28
Picking Up Chicks
Click to view brute force and optimal solutions
29
CHOCOLA - Chocolate
Click to view brute force and optimal solutions
30
ARRANGE - Arranging Amplifiers
Click to view brute force and optimal solutions
31
K Centers Problem
Click to view brute force and optimal solutions
32
Minimum Cost of ropes
Click to view brute force and optimal solutions
33
Find smallest number with given number of digits and sum of digits
Click to view brute force and optimal solutions
34
Rearrange characters in a string such that no two adjacent are same
Click to view brute force and optimal solutions
35
Find maximum sum possible equal sum of three stacks
Click to view brute force and optimal solutions