@iliana reminds me of a prefix tree (or suffix tree in this case) with a flat representation (I forget what they call that kind of representation)