How many distinct BSTs can be constructed with 3 distinct keys?a)4b)5c...
For distinct BST we apply this formula

n = 3 here so C(6, 3) = 20 and 20/4 = 5
How many distinct BSTs can be constructed with 3 distinct keys?a)4b)5c...
Explanation:
To construct distinct BSTs, we must have distinct keys. Let's consider three distinct keys: 1, 2, and 3.
Case 1: The root of the tree is 1.
In this case, the left subtree must be empty, so there is only one possible BST.
Case 2: The root of the tree is 2.
In this case, there are two possible BSTs:
- 2 is the root, 1 is the left child, and 3 is the right child.
- 2 is the root, 3 is the left child, and 1 is the right child.
Case 3: The root of the tree is 3.
In this case, the right subtree must be empty, so there is only one possible BST.
Therefore, the total number of distinct BSTs that can be constructed with three distinct keys is 1 + 2 + 1 = 4.
However, the question asks for the number of distinct BSTs that can be constructed with 3 distinct keys, which means we cannot have a BST with less than 3 nodes. Therefore, we need to consider the case where we have a root, a left child, and a right child.
Case 4: The root of the tree is 1.
In this case, the left subtree must be empty, so there is only one possible BST.
Case 5: The root of the tree is 2.
In this case, there are two possible BSTs:
- 2 is the root, 1 is the left child, and 3 is the right child.
- 2 is the root, 3 is the left child, and 1 is the right child.
Case 6: The root of the tree is 3.
In this case, there are two possible BSTs:
- 3 is the root, 1 is the left child, and 2 is the right child.
- 3 is the root, 2 is the left child, and 1 is the right child.
Therefore, the total number of distinct BSTs that can be constructed with three distinct keys is 1 + 2 + 2 = 5.
Therefore, option 'B' is the correct answer.