File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
src/com/jwetherell/algorithms/data_structures Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -55,17 +55,18 @@ public SuffixTree(C seq) {
55
55
public SuffixTree (C seq , char endSeq ) {
56
56
END_SEQ_CHAR = endSeq ;
57
57
StringBuilder builder = new StringBuilder (seq );
58
- if (builder .indexOf (String .valueOf (seq )) >= 0 )
58
+ if (builder .indexOf (String .valueOf (END_SEQ_CHAR )) < 0 )
59
59
builder .append (END_SEQ_CHAR );
60
60
string = builder .toString ();
61
61
int length = string .length ();
62
62
characters = new char [length ];
63
63
for (int i = 0 ; i < length ; i ++) {
64
- characters [i ] = string .charAt (i );
64
+ char c = string .charAt (i );
65
+ characters [i ] = c ;
65
66
}
66
67
67
- for (int i = 0 ; i < length ; i ++) {
68
- addPrefix (i );
68
+ for (int j = 0 ; j < length ; j ++) {
69
+ addPrefix (j );
69
70
}
70
71
}
71
72
You can’t perform that action at this time.
0 commit comments