a parallel algorithm for constructing a labeled tree