The editing distance between trees: Algorithms and applications