I was calculating the number of Binary Search Trees with n nodes, and I found out that it is Catalan Number.
Now, using DP, here's my attempt.
create arr[n+1];
arr[0]=1;
arr[1]=1;
for(i=2;i<n+1;i++)
arr[i]=0;
for(j=1;j<i;j++)
arr[i]+=arr[i-j]*arr[j];
//arr[n] gives the answer?
Is this the right way?
Can it be any better?