You are viewing a single comment's thread. Return to all comments →
Hi, I tried solving the problem and coded in C. But I am not getting result when N=100. My code is:
void noBST(int N){ unsigned int bst[N+1]; int i,j; bst[0]=1; bst[1]=1; for(i=2;i<=N;i++){ bst[i]=0; for(j=1;j<=i;j++){
bst[i]=bst[i-j]*bst[j-1]+bst[i]; } }
printf("%u\n",bst[N]); } int main(){ int T,N,i; scanf("%d",&T); for(i=0;i
Seems like cookies are disabled on this browser, please enable them to open this website
Number of Binary Search Tree
You are viewing a single comment's thread. Return to all comments →
Hi, I tried solving the problem and coded in C. But I am not getting result when N=100. My code is:
void noBST(int N){ unsigned int bst[N+1]; int i,j; bst[0]=1; bst[1]=1; for(i=2;i<=N;i++){ bst[i]=0; for(j=1;j<=i;j++){
printf("%u\n",bst[N]); } int main(){ int T,N,i; scanf("%d",&T); for(i=0;i