  Let S be a surface of genus g with p punctures with negative Euler
characteristic. We study the diameter of the $\epsilon$-thick part of moduli
space of S equipped with the Teichm\"uller or Thurston's Lipschitz metric. We
show that the asymptotic behaviors in both metrics are of order $\log
\frac{g+p}{\epsilon}$. The same result also holds for the $\epsilon$-thick part
of the moduli space of metric graphs of rank n equipped with the Lipschitz
metric. The proof involves a sorting algorithm that sorts an arbitrary labeled
tree with n labels with simultaneous Whitehead moves, where the number of steps
is of order log(n).
