Introduction to Algorithms
Preserving order in a forest in less than logarithmic time