Algorithms and Data Structures · Junior · Question 71 of 75
What is a greedy algorithm?
- 1One that tries every possible combination
- 2One that uses as much memory as possible to run faster
- ✓Correct answer: One that makes the locally best choice at every step
Explanation
Greedy algorithms are simple and fast, but they only give the optimal answer for some problems, such as making change with standard coins or picking non-overlapping intervals by earliest end. Trying every combination is brute force.