Be the first user to complete this post

  • 0
Add to List
Beginner

47. Find the Size of the Binary Tree

Objective: Given a Binary tree, Find the size of the tree.

Note : The size of the tree is the number of nodes in the tree

Example :

Size-of-Binary-Tree-example

Approach :

  1. Very Simple solution
  2. Start from the root.
  3. Size = 1 (for the root) + Size Of left Sub-Tree + Size Of right Sub-Tree
  4. solve the left sub-tree and right sub-tree recursively.
 
Size of the Tree is: 7