| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 |
Tags
- Protocol
- 315. Count of Smaller Numbers After Self
- iterator
- Convert Sorted List to Binary Search Tree
- data science
- 컴퓨터의 구조
- attribute
- kaggle
- 43. Multiply Strings
- 프로그래머스
- 파이썬
- Python
- Python Implementation
- Substring with Concatenation of All Words
- concurrency
- shiba
- Decorator
- Class
- 밴픽
- 운영체제
- Python Code
- Generator
- Regular Expression
- t1
- DWG
- 시바견
- 715. Range Module
- 109. Convert Sorted List to Binary Search Tree
- LeetCode
- 30. Substring with Concatenation of All Words
Archives
- Today
- Total
목록KMP (1)
Scribbling
KMP 문자열 검색 알고리즘
파이썬 코드로 작성한 KMP 알고리즘이다. 이해하기 어렵다면 아래 사이트를 참고하자. https://bowbowbow.tistory.com/6 def getPi(pattern): m, j = len(pattern), 0 pi = [0] * m for i in range(1, m): while j > 0 and pattern[i] != pattern[j]: j = pi[j-1] if pattern[i] == pattern[j]: j += 1 pi[i] = j return pi def kmp(string, pattern): ret = [] pi = getPi(pattern) n, m, j = len(string), len(pattern), 0 for i in range(n): while j > 0 and s..
Computer Science/Algorithms & Data Structures
2021. 8. 29. 15:18