GATE Exam  >  GATE Questions  >   Number of binary trees formed with 5 nodes a... Start Learning for Free
Number of binary trees formed with 5 nodes are
  • a)
    32
  • b)
    36
  • c)
    120
  • d)
    42
Correct answer is option 'D'. Can you explain this answer?
Verified Answer
Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correc...
Possible number of binary trees formed when n number of nodes are given is 2nCn / n+1 so in this case the number of nodes are 5 so
Number of binary trees possible are = 10C5 / 6 = 10!/ 5! * 5! * 6 → 42
Hence option D is the correct answer
Total number of different Binary tree of size
5 : 14 + 5 + 4 + 5 + 14 = 42
View all questions of this test
Most Upvoted Answer
Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correc...
To determine the number of binary trees that can be formed with 5 nodes, we can use the concept of Catalan numbers. Catalan numbers are a sequence of natural numbers that occur in various counting problems, often involving recursive structures.

The formula to calculate the nth Catalan number is given by:

C(n) = (2n)! / ((n+1)! * n!)

where n is the number of nodes in the binary tree.

Explanation:
- The total number of nodes in a binary tree is given by the sum of the number of nodes in its left subtree and right subtree, plus 1 for the root node.
- Let's consider the left subtree to have l nodes and the right subtree to have r nodes. We have the following equation: l + r + 1 = n
- We can choose any number of nodes for the left subtree, ranging from 0 to n-1. For each choice of l nodes, the number of nodes in the right subtree will be n-1-l.
- The number of binary trees with l nodes in the left subtree and n-1-l nodes in the right subtree can be calculated by multiplying the number of binary trees with l nodes in the left subtree by the number of binary trees with n-1-l nodes in the right subtree.
- Therefore, the total number of binary trees with n nodes is the sum of the number of binary trees for each possible value of l, ranging from 0 to n-1.
- Using the formula for Catalan numbers, we can calculate C(n) by substituting the value of n into the formula.

In this case, we need to calculate C(5):
C(5) = (2*5)! / ((5+1)! * 5!)
= 10! / (6! * 5!)
= (10 * 9 * 8 * 7) / (4 * 3 * 2 * 1)
= 42

Therefore, the number of binary trees that can be formed with 5 nodes is 42.
Explore Courses for GATE exam
Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer?
Question Description
Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared according to the GATE exam syllabus. Information about Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam. Find important definitions, questions, meanings, examples, exercises and tests below for Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer?.
Solutions for Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE. Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Number of binary trees formed with 5 nodes area)32b)36c)120d)42Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice GATE tests.
Explore Courses for GATE exam
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev