Skip to content

Commit b6ea707

Browse files
author
Tushar Roy
committed
move to python package
1 parent 1002ea1 commit b6ea707

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed
Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#Link to theory: http://www.geeksforgeeks.org/z-algorithm-linear-time-pattern-searching-algorithm/
88

9-
10-
11-
129
def z_algo(arr):
1310
z = [0 for i in range(len(arr))]
1411
left , right = 0 , 0
@@ -48,10 +45,10 @@ def makepattern(string , pattern):
4845
if z_values[i] == m:
4946
result.append(i - m - 1)
5047
print result
51-
5248

5349

54-
string = 'abcdeabcd'
55-
pattern = 'abc'
5650

57-
makepattern(string , pattern)
51+
if __name__ == '__main__':
52+
string = 'abcdeabcd'
53+
pattern = 'abc'
54+
makepattern(string , pattern)

0 commit comments

Comments
 (0)