In C++:
codice:
struct recNode
{
  int data;
  recNode *left;
  recNode *right;
};

int countNodes(recNode *root)
{
  if( !root )
    return 0;
  int r = 1;
  if( root->left )
    r += countNodes(root->left);
  if( root->right )
    r += countNodes(root->right);
  return r;
}

int maxLeftRightCount(recNode *root)
{
  if( !root )
    return 0;
  int ml = countNodes(root->left);
  int mr = countNodes(root->right);
  return ml > mr ? ml : mr;
}
Magari funziona