Sagar, That applies to a complete binary tree. What about a non-complete binary tree? The # of nodes that does not necessarily have to be pow(2,i) [i - level of the tree]
On Aug 20, 3:00 pm, sagar pareek <[email protected]> wrote: > and total number of nodes( leaves+internal ) present in a ith level tree is > 2^(i+1)-1 > > > > > > > > > > On Sun, Aug 21, 2011 at 1:28 AM, sagar pareek <[email protected]> wrote: > > 2(power)i or 2^i > > where i is level i=0,1,2,3.......... > > > On Sun, Aug 21, 2011 at 1:27 AM, bugaboo <[email protected]> wrote: > > >> Anyone knows the algorithm to count the number of nodes at each level > >> in a binary tree. Providing the approach and logic better than the > >> actual code itself. > > >> -- > >> You received this message because you are subscribed to the Google Groups > >> "Algorithm Geeks" group. > >> To post to this group, send email to [email protected]. > >> To unsubscribe from this group, send email to > >> [email protected]. > >> For more options, visit this group at > >>http://groups.google.com/group/algogeeks?hl=en. > > > -- > > **Regards > > SAGAR PAREEK > > COMPUTER SCIENCE AND ENGINEERING > > NIT ALLAHABAD > > -- > **Regards > SAGAR PAREEK > COMPUTER SCIENCE AND ENGINEERING > NIT ALLAHABAD -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
