Skip to content

Commit b773d4e

Browse files
committed
fix: adjust sc
1 parent 3f79d02 commit b773d4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

implement-trie-prefix-tree/tolluset.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Trie {
3535

3636
/**
3737
* TC: O(n)
38-
* SC: O(n)
38+
* SC: O(1)
3939
* */
4040
search(word: string): boolean {
4141
let node = this.root;
@@ -53,7 +53,7 @@ class Trie {
5353

5454
/**
5555
* TC: O(n)
56-
* SC: O(n)
56+
* SC: O(1)
5757
* */
5858
startsWith(prefix: string): boolean {
5959
let node = this.root;

0 commit comments

Comments
 (0)