Greedy Algorithms
Everything on SkillVeris tagged Greedy Algorithms — collected across the glossary, study notes, blog, and cheat sheets.
9 resources across 1 library
Interview Questions(9)
How Do You Prove a Greedy Algorithm is Correct?
Greedy algorithm correctness is typically proven with the exchange argument (show any optimal solution can be transformed into the greedy solution without losi…
Jump Game Problem: How Do You Solve It?
The jump game problem — determining if you can reach the last index of an array where each element is the maximum jump length from that position — is best solv…
What is the Container With Most Water Problem?
The container with most water problem finds two vertical lines from an array of heights that, together with the x-axis, form the container holding the most wat…
What is the Interval Scheduling Problem?
The interval scheduling problem asks for the maximum number of non-overlapping intervals you can select from a set, and it is solved optimally with a greedy st…
What is the Activity Selection Problem?
The activity selection problem is the classic greedy exercise of choosing the maximum number of non-conflicting activities from a set given each activity's sta…
What is the Huffman Coding Algorithm?
Huffman coding is a greedy algorithm that builds an optimal prefix-free binary code by repeatedly merging the two least-frequent symbols into a new tree node,…
What is Job Sequencing with Deadlines?
Job sequencing with deadlines is a greedy scheduling problem where each job has a profit and a deadline, only one job can run per time slot, and the goal is to…
What is the Fractional Knapsack Problem?
The fractional knapsack problem asks you to fill a capacity-limited knapsack with items that can be broken into fractions, maximizing total value by always tak…
How Does Greedy Choice Relate to Optimal Substructure?
A greedy algorithm only produces a globally optimal solution when a problem has both the greedy-choice property — a locally optimal choice at each step leads t…