The Catalan Numbers
Explore how to calculate the nth Catalan number through the recursive formula and enhance efficiency using dynamic programming patterns like memoization and tabulation. Understand both naive and optimized solutions, their time and space complexities, and apply these methods to common combinatorial problems.
Statement
Given a number n, find the Catalan number.
Catalan numbers are a special sequence of numbers given by the following set of formulas:
The first expression gives the base case of the formula. The second expression says that the Catalan number is simply the sum of products of specific Catalan number pairs. These specific pairs are just Catalan numbers with the same distance from either end of the series.
for example would be equal to:
...