Class StringInterleavingTest

java.lang.Object
topics.greedy.stringinterleaving.StringInterleavingTest

@DisplayName("String Interleaving (Greedy Heuristic)") class StringInterleavingTest extends Object

Validation Suite for Greedy String Interleaving

Demonstrates successful cases where Greedy works (disjoint or non-ambiguous strings), and explicitly demonstrates the Greedy Trap where it incorrectly fails on valid interleavings.

Author:
vicegd
  • Constructor Details

    • StringInterleavingTest

      StringInterleavingTest()
  • Method Details

    • setup

      @BeforeAll static void setup()
    • shouldVerifyCleanInterleaving

      @Test @DisplayName("Should successfully verify a clean, sequential interleaving (Case A)") void shouldVerifyCleanInterleaving()
    • shouldVerifyMixedInterleaving

      @Test @DisplayName("Should successfully verify a mixed interleaving (Case C)") void shouldVerifyMixedInterleaving()
    • shouldRejectIncorrectLengths

      @Test @DisplayName("Should quickly reject strings with incorrect total lengths") void shouldRejectIncorrectLengths()
    • shouldDemonstrateGreedyTrap

      @Test @DisplayName("Should fall into the Greedy Trap with ambiguous choices") void shouldDemonstrateGreedyTrap()