sum(node *root)
{
if(node==NULL)
return 0;
curr_data=root->data;
root->data=sum(root->left)+sum(root->right);
return root->data+curr_data;
}
On Sat, Dec 10, 2011 at 11:07 PM, AMAN AGARWAL wrote:
> Hi,
>
> Given a Binary tree where nodes may have positive
Hi,
Given a Binary tree where nodes may have positive or negative value, store
the sum of the left and right subtree in the nodes.
Regards,
Aman.
--
AMAN AGARWAL
"Success is not final, Failure is not fatal: It is the courage to continue
that counts!"
--
You received this message because you a