Skip to content

Commit

Permalink
add some important annations
Browse files Browse the repository at this point in the history
  • Loading branch information
ResolveWang committed Mar 10, 2018
1 parent 4704ab5 commit e68d16a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions basic_algrithms/str_algrithms/kmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def get_index(cls, str1, str2):
# 如果是str2的第一个字符
elif next_arr[str2_index] == -1:
str1_index += 1
# 如果str1_index和str2_index的位置没配上,那么把next_arr向右滑动str2_index个
# 如果str1_index和str2_index的位置没配上,那么把str2向右滑动str2_index个
# 位置再和str1_index匹配
else:
str2_index = next_arr[str2_index]
Expand All @@ -38,7 +38,7 @@ def get_next_arr(cls, str2):
next_arr[0] = -1
# 下标当前位置
pos = 2
# 最长前缀的后一个字符的位置
# 最长前缀
cn = 0

while pos < length:
Expand Down

0 comments on commit e68d16a

Please sign in to comment.