mirror of
https://github.com/Hizenberg469/Algorithms-snippets.git
synced 2026-04-19 22:52:23 +03:00
Catalan Number
This commit is contained in:
@@ -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