When running the algorithm on the string ‘AEKEAAEKEAAEKEA$‘ looking for the longest substring with at least 3 occurences all the nodes in the suffix tree have maximum 2 branches, how can that be?
The correct result should be the substring ‘AEKEA‘.
You can easily see the tree in the online suffix tree builder
I just followed the Wikipedi description:
“The problem of finding the longest substring with at least k
occurrences can be found by first preprocessing the tree to count the
number of leaf descendants for each internal node, and then finding
the deepest node with at least k descendants”
What am I missing here?
Thank you.
I don’t think that website is correct. When I run ‘AEKEAAEKEAAEKEA’ through my suffix tree, I get the following tree.
As you can see from this branch, you’ve found your longest substring with 3 occurences.