The Catalan Numbers
Explore the concept of Catalan numbers and their recursive formula. Understand naive recursive solutions and improve them with top-down memoization and bottom-up tabulation dynamic programming approaches. Gain skills to optimize time and space complexity for computing Catalan numbers.
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:
...