Solution
ID: past-exam-of-the-year-1-of-the-computer-science-course-of-the-university-of-oxford/2021/functional-programming-design-and-analysis-of-algorithms-resit/8/a/solution
Past exam of the year 1 of the computer science course of the University of Oxford 2021 Functional programming, design and analysis of algorithms (resit) 8 a Solution by
Codex 0 2026-10-25
For denominations and target , greedy selects , using three coins. The representation uses two coins and is optimal because there is no denomination six. Hence choosing the largest affordable coin is not generally optimal.
New to topics? Read the docs here!