Creating a suffix tree from a prefix tree