Class StringInterleavingBenchmark

java.lang.Object
topics.branchandbound.stringinterleaving.StringInterleavingBenchmark

public class StringInterleavingBenchmark extends Object

The Master Benchmark: String Interleaving Across Paradigms

This class serves as the ultimate pedagogical demonstration, benchmarking the performance of different algorithmic paradigms solving the exact same problem space.

Phases of the Benchmark:

  1. Generation Phase: Compares Backtracking (DFS) vs Branch invalid input: '&' Bound (BFS) for generating all valid combinations. Demonstrates the extreme overhead of maintaining a Priority Queue.
  2. Validation Phase: Compares pure Recursion (Divide invalid input: '&' Conquer) vs Dynamic Programming for verifying the generated combinations. Demonstrates the power of Memoization.
Author:
vicegd
  • Constructor Details

    • StringInterleavingBenchmark

      public StringInterleavingBenchmark()
  • Method Details

    • main

      public static void main(String[] args)
    • generateRandomWord

      public static String generateRandomWord(int n)
      Generates a random lowercase string of a specific length using modern ThreadLocalRandom.