From what I see from this paper
This is a trie with suffix compression to reduce the final state changes to match, since I was working on something similar, I also felt it was necessary to save space. This was the solution that I was thinking about the data structure, I am interested to know if there are other approaches:
struct cdawg { int issuffix:1; int length:31; char *s; // suffix if issuffix == 1, else array of valid transition chars struct cdawg *trans; // array of next states based on the index of trans char in s, null if suffix };
source share