Skip to content

Add Catalan numbers implementation using combinatorial formula#3126

Open
dhruv-bamal wants to merge 1 commit intoTheAlgorithms:masterfrom
dhruv-bamal:add-catalan-math
Open

Add Catalan numbers implementation using combinatorial formula#3126
dhruv-bamal wants to merge 1 commit intoTheAlgorithms:masterfrom
dhruv-bamal:add-catalan-math

Conversation

@dhruv-bamal
Copy link
Copy Markdown

Description

Added Catalan Numbers implementation using a combinatorial approach.

Motivation

The repository already contains a Dynamic Programming solution. This implementation provides a mathematical approach with improved time and space efficiency.

Complexity

  • Time: O(n)
  • Space: O(1)

Notes

  • Avoids factorial computation to prevent overflow
  • Works within uint64_t limits

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