Write a method called doublePositives that doubles all data values greater than 0 in a binary tree of integers.
Add the above method to the IntTree class from this chapter. You may define additional private methods to implement your public method if necessary. Several problem descriptions refer to the following reference binary trees:
public void doublePositives()
{
doublePositives(overallRoot);
}
private void doublePositives(IntTreeNode root)
{
if(root == null)
return;
if(root.data > 0)
{
root.data = root.data * 2;
}
doublePositives(root.left);
doublePositives(root.right);
}