Ideas
Given a node in the tree, find its first child node, and then traverse all the sibling nodes of the child node to find the solution
Code
int childCount(TreeNode current){
int count = 0;
current = current.getFirstChild();
while(current != null){
count++;
current = current.getNextSibling();
}
return count;
}