Skip to content

Latest commit

 

History

History

Check if Given Binary Tree is Sum Tree Or Not

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

Write a function that returns true if the given Binary Tree is SumTree else false. A SumTree is a Binary Tree where the value of a node is equal to sum of the nodes present in its left subtree and right subtree. An empty tree is SumTree and sum of an empty tree can be considered as 0. A leaf node is also considered as SumTree.

          26
        /   \
      10     3
    /    \     \
  4      6      3