Compute examples and class distributions in tree nodes.