Ultimate_Algorithms_Repository
Ultimate_Algorithms_Repository copied to clipboard
Find sum of all right leaves in a given Binary Tree .
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 .
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.