Skip to content

Commit fa05386

Browse files
committed
modify code
1 parent 9e459d5 commit fa05386

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/class044/Code02_TrieTree.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ public static int prefixNumber(String pre) {
7171
public static void delete(String word) {
7272
if (search(word) > 0) {
7373
int cur = 1;
74+
// 如下这行代码,讲课的时候没加
75+
// 本题不会用到pass[1]的信息,所以加不加都可以
76+
// 不过正确的写法是加上
77+
pass[cur]--;
7478
for (int i = 0, path; i < word.length(); i++) {
7579
path = word.charAt(i) - 'a';
7680
if (--pass[tree[cur][path]] == 0) {

0 commit comments

Comments
 (0)