Homework/HW07/bin-trees-B.cc
int numberOfSiblingPairs (nodePtr rootp)
{
    if (!rootp)
        //Base case.  If the node doesn't exist, return 0.
        return 0;
    else
        //Adds one if both children exist, and zero if they don't, in addition to whatever the
        //furthing recursing adds.
        return   (rootp->left && rootp->right ? 1 : 0)
               + numberOfSiblingPairs(rootp->left)
               + numberOfSiblingPairs(rootp->right);
}
/************  N U M B E R   O F   S I B L I N G   P A I R S  ***************
                                                                           
This function counts the sibling pairs (if any) in the binary tree pointed
to by "rootp".  The function is recursive.  The function documentation and 
heading were written by W. Knight.  
See the function numberOfOnlyChildren for implementation ideas. 
*/
N U M B E R   O F   S I B L I N G   P A I R S
This function counts the sibling pairs (if any) in the binary tree pointed
to by "rootp".  The function is recursive.  The function documentation and
heading were written by W. Knight.
See the function numberOfOnlyChildren for implementation ideas.
N U M B E R O F S I B L I N G P A I R S This function counts the sibling pairs ( if any ) in the binary tree pointed to by " rootp " . The function is recursive . The function documentation and heading were written by W . Knight . See the function numberOfOnlyChildren for implementation ideas .
int numberOfSiblingPairs (nodePtr rootp)
{
    if (!rootp)
        return 0;
    else
        return   (rootp->left && rootp->right ? 1 : 0)
               + numberOfSiblingPairs(rootp->left)
               + numberOfSiblingPairs(rootp->right);
}
int numberOfSiblingPairs ( nodePtr rootp ) { if ( ! rootp ) return 0 ; else return ( rootp -> left && rootp -> right ? 1 : 0 ) + numberOfSiblingPairs ( rootp -> left ) + numberOfSiblingPairs ( rootp -> right ) ; }
N U M B E R   O F   S I B L I N G   P A I R S
This function counts the sibling pairs (if any) in the binary tree pointed
to by "rootp".
N U M B E R O F S I B L I N G P A I R S This function counts the sibling pairs ( if any ) in the binary tree pointed to by " rootp " .
//Base case.  If the node doesn't exist, return 0. //Adds one if both children exist, and zero if they don't, in addition to whatever the //furthing recursing adds.