Comparing similar ordered trees in linear-time