The _______ approach for solving the coin change problem may not always yield the optimal solution.
- Greedy
- Recursive
- Brute-force
- Iterative
The correct option is "Greedy." While the greedy approach works for some cases, it may not always yield the optimal solution for the coin change problem. Greedy algorithms make locally optimal choices at each stage, which may not lead to the overall optimal solution.
Loading...
Related Quiz
- What is the difference between a static array and a dynamic array?
- How does dynamic programming help in solving the LCS problem efficiently?
- The algorithm selects the next node with the _______ shortest distance from the source node.
- In DFS, the time complexity is _______ in the worst case for traversing a graph with V vertices and E edges.
- In a priority queue, elements are retrieved based on their _______ rather than their order of insertion.