Validation of running time. (a) Total running time divided by n log2 n.. (b) The percent of time used on the three parts of the algorithm. The left figure shows the total running time divided by n log2 n showing that the theoretical running time is achieved in the implementation. The right figure shows the percent of time used on the three parts of the algorithm: constructing the HDT of the second tree, coloring the leaves in the first tree, and updating the HDT accordingly. Constructing the HDT takes a considerable part of the time, but as the trees grow, updating the HDT takes a larger part. The plots show the average over 50 experiments for each size n.