Check if tree is ultrametric