Can u explain the combination part when we have computed the x and y ? how many ways we can form a subtree and from left and right ?
Catalan number concept
For root node i where i ranges from 1 to n.
The candidate nodes which can become a left child of this root node are nodes 1 to i-1.
So number of ways to choose such node = i-1. So number of possible left subtrees depends on i-1.
The candidate node which can become a right child of this root node are nodes i+1 to n.
So number of ways to choose such node =n-i . So total number of possible right subtrees for root node i depends on n-i.
By this only we get the recursive relation. You can watch the video once again for more clarity.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.