Beta. Content is under active construction and has not been peer-reviewed. Report errors on
GitHub
.
Disclaimer
Theorem
Path
Curriculum
Paths
Demos
Diagnostic
Search
Quiz Hub
/
Greedy Algorithms
Greedy Algorithms
3 questions
Difficulty 4-4
View topic
Intermediate
0 / 3
3 intermediate
Adapts to your performance
1 / 3
intermediate (4/10)
compare
A greedy algorithm makes locally optimal choices at each step. When does this produce a globally optimal solution?
Hide and think first
A.
Greedy is always optimal for any problem, as long as the algorithm is implemented correctly
B.
Only for problems with at most polynomial size; exponential problems need dynamic programming
C.
Whenever the problem has a recursive structure, greedy always works
D.
When the problem has optimal substructure AND the greedy choice is always safe — formally, when it fits the matroid or exchange-argument framework
Submit Answer