[algogeeks] Re: Trees

2011-08-11 Thread amit karmakar
5 is possible. Considering root of the tree to be at level 0, level 1 and level 2 are completely filled. There are 5 internal nodes in level 1, (since all level 2 nodes are present) Now only (10 - 5(from level 1)+1(the root)) nodes are required. So choose 4 nodes from level 2 and make them

[algogeeks] Re: Trees

2011-08-11 Thread amit karmakar
I tried solving this problem and came to conclusion that none of the options can be correct. Indeed for value 5, you can have a solution. Then i googled for this question, and found out that, you have an option missing. i.e 5 :| On Aug 11, 9:01 pm, rajeev bharshetty rajeevr...@gmail.com wrote:

Re: [algogeeks] Re: Trees

2011-08-11 Thread rajeev bharshetty
@amit: Thanks On Thu, Aug 11, 2011 at 10:04 PM, amit karmakar amit.codenam...@gmail.comwrote: I tried solving this problem and came to conclusion that none of the options can be correct. Indeed for value 5, you can have a solution. Then i googled for this question, and found out that, you

[algogeeks] Re: Trees

2011-08-11 Thread amit karmakar
* correction (5*5(There are 5*5 nodes in level 2)-4(These became internal nodes..)) On Aug 11, 9:58 pm, amit karmakar amit.codenam...@gmail.com wrote: 5 is possible. Considering root of the tree to be at level 0, level 1 and level 2 are completely filled. There are 5 internal nodes in level

Re: [algogeeks] Re: Trees

2011-08-11 Thread paul suganthan
Answer is 5. the relation is No of leaf nodes = (n-1)*(no of internal nodes) + 1 Paul On Thu, Aug 11, 2011 at 10:44 PM, amit karmakar amit.codenam...@gmail.comwrote: * correction (5*5(There are 5*5 nodes in level 2)-4(These became internal nodes..)) On Aug 11, 9:58 pm, amit karmakar

Re: [algogeeks] Re: Trees

2011-08-11 Thread Raman
How is this formula obtained? -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group. To view this discussion on the web visit https://groups.google.com/d/msg/algogeeks/-/zBQSNmP4ITQJ. To post to this group, send email to algogeeks@googlegroups.com.

Re: [algogeeks] Re: Trees

2011-08-11 Thread Nitin Nizhawan
I am also getting , 5 as answer now. here is what I did. In any n-ary tree we can add one internal node by adding n-children to any one of its leaf nodes. This operation creates one internal node and at the cost one leaf node and adds n new leaf nodes. L(i) be leaf nodes in a tree with i internal