Homework/HW07/bin-trees-B.cc
int sumOfLeafData (nodePtr rootp)
{
    if (!rootp)
        //Base case.  If the node doesn't exist, return 0.
        return 0;
    else if (!rootp->left && !rootp->right)
        //If the node is a leaf, return its datum.  Don't need to recurse further because of the
        //fact that the node IS a leaf.
        return rootp->datum;
    else
        //This node has at least one child, so continue to recurse.
        return   sumOfLeafData(rootp->left)
               + sumOfLeafData(rootp->right);
}
/******************  S U M   O F   L E A F   D A T A  **********************

This function calculates and returns the sum of the data values in the leaves
of the binary tree pointed to by "rootp".  The function is recursive.  
The function documentation and heading were written by W. Knight.  */
S U M   O F   L E A F   D A T A
This function calculates and returns the sum of the data values in the leaves
of the binary tree pointed to by "rootp".  The function is recursive.
The function documentation and heading were written by W. Knight.
S U M O F L E A F D A T A This function calculates and returns the sum of the data values in the leaves of the binary tree pointed to by " rootp " . The function is recursive . The function documentation and heading were written by W . Knight .
int sumOfLeafData (nodePtr rootp)
{
    if (!rootp)
        return 0;
    else if (!rootp->left && !rootp->right)
        return rootp->datum;
    else
        return   sumOfLeafData(rootp->left)
               + sumOfLeafData(rootp->right);
}
int sumOfLeafData ( nodePtr rootp ) { if ( ! rootp ) return 0 ; else if ( ! rootp -> left && ! rootp -> right ) return rootp -> datum ; else return sumOfLeafData ( rootp -> left ) + sumOfLeafData ( rootp -> right ) ; }
S U M   O F   L E A F   D A T A
This function calculates and returns the sum of the data values in the leaves
of the binary tree pointed to by "rootp".
S U M O F L E A F D A T A This function calculates and returns the sum of the data values in the leaves of the binary tree pointed to by " rootp " .
//Base case.  If the node doesn't exist, return 0. //If the node is a leaf, return its datum.  Don't need to recurse further because of the //fact that the node IS a leaf. //This node has at least one child, so continue to recurse.