## Recursion to check the "rightness" of a search tree.

Hi everyone. I'm having trouble programming a recursive method that determines the "rightness" of a search tree. The rightness of a node is 1 if the size of its right subtree is larger than the size of its left subtree. The rightness of a node is -1 if the size of its left subtree is larger than the size of its right subtree. The rightness of a node is 0 if the sizes are equal. The rightness of a subtree is equal to the rightness of its left subtree plus the rightness of its right subtree plus the rightness of its root. The rightness of an empty tree is 0.

What I have runs, but I don't think it is correct. Although, I honestly don't fully understand the problem:

This is the rightness method:
Java Code:
```public int Rightness()
{
return Rightness(Root);
}
private int Rightness(Tree_Node T)
{
if(T != null)
{
if(Size(T.Left) > Size(T.Right))
{
return Rightness(T.Left) + Rightness(T.Right) - 1;
}
else if(Size(T.Left) < Size(T.Right))
{
return Rightness(T.Left) + Rightness(T.Right) + 1;
}
else
{
return Rightness(T.Left) + Rightness(T.Right);
}
}
return 0;
}```
This is size:

Java Code:
```private int Size(Tree_Node T)
{
if(T != null)
{
return Size(T.Left) + Size(T.Right) +1;
}
return 0;
}```