1.

C++ program to calculate number of tree possible with given number of nodes using catalan number

Answer»

tion:#include using NAMESPACE std; // A RECURSIVE function to find NTH catalan number UNSIGNED long int catalan(unsigned int n) { // Base case if (n <= 1) return 1; // catalan(n) is sum of catalan(i)*catalan(n-i-1) unsigned long int res = 0; for (int i=0; i



Discussion

No Comment Found