Ayu-hack / Hacktoberfest-Contributions

This repository helps beginners contribute to open source and participate in Hacktoberfest. We welcome all pull requests (Python & Java), prioritize genuine contributions, and promote good first issues! #hacktoberfest2022 #hacktoberfest2023 #hacktoberfest2024
20 stars 51 forks source link

Added Java Program to Calculate the nth Catalan Number Using Dynamic Programming #102

Closed Rekklessss closed 1 month ago

Rekklessss commented 1 month ago

Solved Issue #99 This pull request adds a Java program to calculate the nth Catalan number using dynamic programming. The Catalan numbers form an important sequence in combinatorics, used in various counting problems like binary search trees, expressions with balanced parentheses, and paths in grids.

Example Usage:

The program prompts the user for an integer n (where n <= 50) and prints the nth Catalan number.

Testing:

The program has been tested with several values of n to verify the correctness of the Catalan number calculations. Added input validation to ensure that the input is within the acceptable range.

Attachments:

image
Ayu-hack commented 1 month ago

Great Work ! Merged. More repos are available for pull requests, and they’re part of Hacktoberfest 2024. Feel free to tag me in your Hacktoberfest certificate or badges LinkedIn post! 😄

👉 Follow my GitHub and connect with me on LinkedIn! ⭐ Star these repos to stay updated for next year’s Hacktoberfest!