Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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‎

Lines changed: 3 additions & 3 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /