Ultimate_Algorithms_Repository icon indicating copy to clipboard operation
Ultimate_Algorithms_Repository copied to clipboard

Find sum of all right leaves in a given Binary Tree .

Open maneprajakta opened this issue 5 years ago • 1 comments

In Tree data structure i want to add how to find sum of all right leaves in BST. I can do this in C++ along with an explanation can I do this .

maneprajakta avatar Oct 02 '20 05:10 maneprajakta

The idea is to traverse the tree starting from the root and check if the node is the leaf node or not. If the node is the right leaf than add data of right leaf to sum variable.

I can code it in c++ if you assign me.

satyamsaran avatar Oct 02 '20 06:10 satyamsaran