Computer Science, asked by babynujsamya, 1 year ago

Prove that in a binary tree the number of vertices is always odd

Answers

Answered by kvnmurty
4
In a complete  binary tree there is exactly 2^0 = 1 root. That is at level 1.
The next level contains 2 vertices.  The next level contains 2^2 = 4 vertices.

Thus the total number of vertices in a complete binary tree of level n is :
      1 + 2 + 4 + 8 + .....+  2^(n-1) =  2^n  - 1

So the total is always an odd number.

Similar questions