Skip to content

Latest commit

 

History

History

Sum Of All Right Leaves

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Given a Binary Tree, find sum of all right leaves in it.

Input : 
         1
        /  \
       2    3
     /  \     \
    4    5     8 
     \        /  \
      2       6   7

Output :
sum = 2 + 5 + 7 = 14