Ukkonen-SuffixTree
Ukkonen-SuffixTree copied to clipboard
Some thing went wrong
Hi, when enter a string: vbxkabcabx
, your code returns 10 edges which is actually not enough.
Enter String
vbxkabcabx
StartNode EndNode SuffixLink FirstIndex lastIndex String
9 10 0 9 9 x
0 9 6 4 5 ab
0 8 0 6 9 cabx
6 7 0 6 9 cabx
0 1 0 0 9 vbxkabcabx
6 2 0 2 9 xkabcabx
0 3 0 2 9 xkabcabx
0 4 0 3 9 kabcabx
9 5 0 6 9 cabx
0 6 0 1 1 b
Total edges: 10
I think you missed the edge (String = x
) from node number 6
(the edge from node 6
to node 2
should be divided into two parts). The same should apply for edge from node 0
and 3