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) {
5555 public SuffixTree (C seq , char endSeq ) {
5656 END_SEQ_CHAR = endSeq ;
5757 StringBuilder builder = new StringBuilder (seq );
58- if (builder .indexOf (String .valueOf (seq )) >= 0 )
58+ if (builder .indexOf (String .valueOf (END_SEQ_CHAR )) < 0 )
5959 builder .append (END_SEQ_CHAR );
6060 string = builder .toString ();
6161 int length = string .length ();
6262 characters = new char [length ];
6363 for (int i = 0 ; i < length ; i ++) {
64- characters [i ] = string .charAt (i );
64+ char c = string .charAt (i );
65+ characters [i ] = c ;
6566 }
6667
67- for (int i = 0 ; i < length ; i ++) {
68- addPrefix (i );
68+ for (int j = 0 ; j < length ; j ++) {
69+ addPrefix (j );
6970 }
7071 }
7172
You can’t perform that action at this time.
0 commit comments