Skip to content

Suffix Tree implementation#383

Closed
shaqed wants to merge 2 commits into
TheAlgorithms:masterfrom
shaqed:master
Closed

Suffix Tree implementation#383
shaqed wants to merge 2 commits into
TheAlgorithms:masterfrom
shaqed:master

Conversation

@shaqed

@shaqed shaqed commented Feb 21, 2018

Copy link
Copy Markdown

Hey, I added a SuffixTree implementation inside DataStructures/Trees

public static void main(String[] args) {
SuffixTree suffixTree = new SuffixTree("senseses$");
// Answer is in root, run the debugger to see its children or follow the print below
Node root = suffixTree.getRoot();

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What for a role has this line?

// Characters match, continue looking
ans++;
} else {
break;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That line can be a problem. For example if the first characters don't match but all others are equal the method don't counts it. Because it breaks the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants