Kumar-laxmi / Algorithms

A Repository for algorithms in C, C++, Python and Java
Apache License 2.0
325 stars 367 forks source link

Implementation of Catalan Number #1603

Closed divyansh956 closed 7 months ago

divyansh956 commented 1 year ago

This aims to implement the calculation of Catalan numbers in four different programming languages: C, C++, Python, and Java.

Catalan numbers are a sequence of natural numbers that have various combinatorial interpretations and applications. The Catalan number sequence starts with 1 and continues as follows: 1, 1, 2, 5, 14, 42, 132, 429, 1430, and so on.

The nth Catalan number, denoted as C(n), represents the number of different ways certain combinatorial structures can be arranged. The formula to calculate the nth Catalan number is:

C(n) = (2n)! / [(n + 1)! * n!]

Applications

Combinatorics and Counting Binary Trees and BSTs Dyck Paths Triangulations Parenthesis Parsing and Expression Evaluation Catalan Solid Structures Pathfinding and Grid Problems Game Theory Cryptography and Coding Theory Computer Science Algorithms

divyansh956 commented 1 year ago

Please assign me @Kumar-laxmi

github-actions[bot] commented 7 months ago

Stale issue message