We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a7dec2e commit 85a1890Copy full SHA for 85a1890
src/_DataStructures_/Trees/SuffixTree/index.js
@@ -32,7 +32,7 @@ class Node {
32
class SuffixTree {
33
constructor(string) {
34
this.head = new Node();
35
- this.string = string;
+ this.string = string.toLowerCase();
36
}
37
38
constructSuffixTree() {
@@ -103,6 +103,7 @@ class SuffixTree {
103
104
105
findSubstring(string) {
106
+ string = string.toLowerCase();
107
if (!this.head.next.has(string[0])) {
108
return -1;
109
@@ -131,10 +132,9 @@ class SuffixTree {
131
132
133
134
-// const st = 'asdjkxhcjbzdmnsjakdhasdbajw';
135
+// const st = 'CatatecheeseMouseatecheesetooCatatemousetoo';
136
// const s = new SuffixTree(st);
137
// s.constructSuffixTree();
-// // console.log(s.head.next);
138
139
140
// for (let i = 0; i < st.length; i++) {
0 commit comments