Proof. The idea is the same as in Lemma 3: for each vertex of the suffix tree we
construct a structure containing all its ancestors sorted according to their depths. Note that
the depths are smaller than M so we can apply Lemma 4. The total
construction time is O(M × M < ) = O(M 1+< ) and answering a query reduces to one predecessor
lookup. ✷