Greedy
Locally optimal choices
Activity Selection
Picks the maximum number of non-overlapping activities by always taking the one that finishes earliest.
Time O(n log n) · Space O(1)
Fractional Knapsack
Maximizes value under a weight limit when items can be split: take items in value/weight order, breaking the last one.
Time O(n log n) · Space O(1)
Job Sequencing
Schedules deadline-bound unit jobs for maximum profit: greedily place each job (highest profit first) into the latest free hour before its deadline.
Time O(n²) · Space O(n)
Huffman Coding
Builds an optimal prefix code: repeatedly merge the two least frequent trees, then read codes off the root-to-leaf paths.
Time O(n log n) · Space O(n)