[Suffix tree] Completed functional suffix tree construction part