Class ChangeTest
java.lang.Object
topics.greedy.change.ChangeTest
Validation Suite for Greedy Coin Change
Demonstrates both the success cases of the Greedy algorithm and the mathematical boundaries where it fails to find the global optimum (The Greedy Trap).
- Author:
- vicegd
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static voidsetup()(package private) void(package private) void(package private) void
-
Constructor Details
-
ChangeTest
ChangeTest()
-
-
Method Details
-
setup
@BeforeAll static void setup() -
shouldFindOptimalSolution
@Test @DisplayName("Should find the mathematically optimal solution for canonical coin sets") void shouldFindOptimalSolution() -
shouldDemonstrateSubOptimalGreedyBehavior1
@Test @DisplayName("Should fall into the Greedy Trap (Sub-optimal solution #1)") void shouldDemonstrateSubOptimalGreedyBehavior1() -
shouldDemonstrateSubOptimalGreedyBehavior2
@Test @DisplayName("Should fall into the Greedy Trap (Sub-optimal solution #2)") void shouldDemonstrateSubOptimalGreedyBehavior2()
-