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

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
Asked:
emi_sastra
  • 2
1 Solution
 
TommySzalapskiCommented:
This is very similar to finding the number of nodes under X.
Instead of
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
 
TommySzalapskiCommented:
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
 
emi_sastraAuthor 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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now