To find the number of binary trees that can be formed with \( n \) distinct nodes, we use the Catalan number.
The formula for the \( n^\text{th} \) Catalan number is:
\[ C_n = \frac{1}{n+1} \binom{2n}{n} \]
Step 1: Substitute \( n = 4 \):
\[ C_4 = \frac{1}{4 + 1} \binom{2 \cdot 4}{4} = \frac{1}{5} \binom{8}{4} \]
Step 2: Compute the binomial coefficient \( \binom{8}{4} \):
\[ \binom{8}{4} = \frac{8!}{4! \cdot 4!} = \frac{8 \cdot 7 \cdot 6 \cdot 5}{4 \cdot 3 \cdot 2 \cdot 1} = 70 \]
Step 3: Calculate the Catalan number:
\[ C_4 = \frac{1}{5} \cdot 70 = 14 \]
Therefore, the number of binary trees that can be formed with 4 distinct nodes is 14.
Five friends A, B, C, D, and E are sitting in a row facing north, but not necessarily in the same order:
B is to the immediate left of C
E is not at any of the ends
D is to the right of E but not next to C
A is at one of the ends
Who is sitting in the middle?
Which of the following is not a characteristic of Object-Oriented Programming?