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 nodes, then L(i+1) = L(i) + n - 1 L(0) = 1 , since tree with root node has 0 internal nodes and one leave node L(i) = L(0) + i*(n-1) or L(i) = i*(n-1) + 1
On Thu, Aug 11, 2011 at 11:34 PM, Raman <raman.u...@gmail.com> wrote: > 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. > To unsubscribe from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.