Count number of binary search tree created for array of size n

Count number of binary search tree created for array of size n

Output:

package linkedlist;

public class CountNumberOfBST_Catalan {
static int value = 0;

public static void main(String[] args) {

int totalBST = numberOfBST(5);
System.out.println(“The total BST is “+totalBST);
}

private static int numberOfBST(int n) {
int T[] = new int[n+1];
T[0] = 1;
T[1] = 1;
for(int i=2; i <= n; i++){ for(int j=0; j

Leave a Reply

Your email address will not be published. Required fields are marked *