The Catalan Numbers
Explore how to find the nth Catalan number through recursive and dynamic programming patterns. Understand both naive recursive and optimized top-down memoization and bottom-up tabulation techniques to efficiently solve this classic problem encountered in coding interviews.
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:
...