File tree 1 file changed +3
-3
lines changed
src/_DataStructures_/Trees/SuffixTree
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ class Node {
32
32
class SuffixTree {
33
33
constructor ( string ) {
34
34
this . head = new Node ( ) ;
35
- this . string = string ;
35
+ this . string = string . toLowerCase ( ) ;
36
36
}
37
37
38
38
constructSuffixTree ( ) {
@@ -103,6 +103,7 @@ class SuffixTree {
103
103
}
104
104
105
105
findSubstring ( string ) {
106
+ string = string . toLowerCase ( ) ;
106
107
if ( ! this . head . next . has ( string [ 0 ] ) ) {
107
108
return - 1 ;
108
109
}
@@ -131,10 +132,9 @@ class SuffixTree {
131
132
}
132
133
}
133
134
134
- // const st = 'asdjkxhcjbzdmnsjakdhasdbajw ';
135
+ // const st = 'CatatecheeseMouseatecheesetooCatatemousetoo ';
135
136
// const s = new SuffixTree(st);
136
137
// s.constructSuffixTree();
137
- // // console.log(s.head.next);
138
138
139
139
140
140
// for (let i = 0; i < st.length; i++) {
You can’t perform that action at this time.
0 commit comments