mirror of
https://github.com/Hizenberg469/Algorithms-snippets.git
synced 2026-10-31 02:33:38 +02:00
Catalan Number
This commit is contained in:
1 parent
7f2fb15c3f
commit
3f2e435cf0
1 file changed
+5
@@ -20,6 +20,11 @@ int catalanNumber( int n ){
|
||||
return dp[n];
|
||||
}
|
||||
|
||||
/*
|
||||
Formula for Catalan Number
|
||||
(2n-C-n)/(n+1)
|
||||
*/
|
||||
|
||||
int main(int argc, char* argv[] ){
|
||||
|
||||
cout << catalanNumber(3) << '\n';
|
||||
|
||||
Reference in new issue
Block a user