Skip to main content
Theorem
Path
Curriculum
Paths
Labs
Diagnostic
Case Study
Blog
Search
Sign in
Quiz Hub
/
Greedy Algorithms
Greedy Algorithms
3 selected
Difficulty 4-4
3 unseen
View topic
Intermediate
New
0 answered
3 intermediate
Adapts to your performance
Question 1 of 3
120s
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
I don't know