


Input: ‘N’ = 2
Output: 2
Explanation: We can form two different BSTs with two nodes only.
One with node one as a root and the other with node two as a root.
The first line of input contains an integer ‘T', denoting the number of test cases.
Each test case contains a single integer 'N' denoting the number of nodes.
For each test case, print the total number of different binary search trees that can be formed.
You don’t need to print anything. It has already been taken care of. Just implement the given function.
1 <= ‘T’ <= 10
1 <= 'N' <= 10^2
Timit Limit: 1 sec
Algorithm :
Algorithm :
We will start from the base conditions instead of the other way around.
We have base conditions of dp[0] = dp[1] = 1. Then we will calculate a result for each number of nodes i from 2...n one after another. For i nodes. We will consider each of the node j from 1...i as the root node of BST.
Algorithm :