Skip to content

Conversation

RitikTiwary519
Copy link

Description

This PR adds the implementation of the Catalan Number algorithm using Dynamic Programming in C++ under the dynamic_programming directory.

Features:

  • Efficient Bottom-Up DP approach.
  • Time complexity reduced from exponential to O(n²).
  • Includes inline comments and example usage in main() for quick testing.

Time and Space Complexity

  • Time Complexity: O(n^2)
  • Space Complexity: O(n) (only stores the last n values)

Files Added

catalan_number.cpp

Related Issue

No specific issue linked, but this adds a key combinatorial algorithm often used in competitive programming and dynamic programming problem sets.


Sample Output

For n = 5, output will be:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant