• Status: Solved
• Priority: Medium
• Security: Public
• Views: 322

# NUMBER OF 3 LEGS TREE UNDER A NODE AT X LEVEL OF NUMBER OF LEVEL

Hi All,

I want to know the above title.

Suppose there 4 level :

1. Node 1 at Level 1 = (1,2,3), (2,4,5), (3,6,7), (4,8,9), (5, 10, 11), (6, 12, 13), (7, 14, 15) = 7 Tree
2. Node 2 and 3 at Level 2 = (2,4,5), (3,6,7), (4,8,9), (5, 10, 11), (6, 12, 13), (7, 14, 15) = 6 Tree / 2 = 3 of each node.
3. Node 4 and 5 at Level 2 = (4,8,9), (5, 10, 11), (6, 12, 13), (7, 14, 15) = 4 Tree / 2 = 2 Tree of each node

How to do the math ?

Thank you.
0
emi_sastra
• 2
1 Solution

Commented:
This is very similar to finding the number of nodes under X.
2^(D-L+1) - 2
use 2^(D-L) - 1

The -2 changes to a -1 since the one starting at X is included.
The D-L+1 changes to a D-L since this is 3 node trees so the bottom level of nodes is not included (as roots).
0

Commented:
Just as in http:Q_27409145.html D is the total depth of the original tree and L is the level of node X
0

Author Commented:
Yes, get it.

Thank you very much for your help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.