Calculates the differences between two tree-like structures
