When Is the Ideal Time to Prune a Tree?