Skip to content

Commit 85a1890

Browse files
committed
--update : convert string to lowerCase
1 parent a7dec2e commit 85a1890

File tree

1 file changed

+3
-3
lines changed
  • src/_DataStructures_/Trees/SuffixTree

1 file changed

+3
-3
lines changed

src/_DataStructures_/Trees/SuffixTree/index.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Node {
3232
class SuffixTree {
3333
constructor(string) {
3434
this.head = new Node();
35-
this.string = string;
35+
this.string = string.toLowerCase();
3636
}
3737

3838
constructSuffixTree() {
@@ -103,6 +103,7 @@ class SuffixTree {
103103
}
104104

105105
findSubstring(string) {
106+
string = string.toLowerCase();
106107
if (!this.head.next.has(string[0])) {
107108
return -1;
108109
}
@@ -131,10 +132,9 @@ class SuffixTree {
131132
}
132133
}
133134

134-
// const st = 'asdjkxhcjbzdmnsjakdhasdbajw';
135+
// const st = 'CatatecheeseMouseatecheesetooCatatemousetoo';
135136
// const s = new SuffixTree(st);
136137
// s.constructSuffixTree();
137-
// // console.log(s.head.next);
138138

139139

140140
// for (let i = 0; i < st.length; i++) {

0 commit comments

Comments
 (0)