为什么使用正则表达式会慢?
NFA构造O(n),匹配O(nm)
DFA构造O(2^n),最小化O(kn'logn')(N'=O(2^n)),匹配O(m)
n=regex长度,m=串长,k=字母表大小,n'=原始的dfa大小
New to Steemistry?
Promoted Posts
- Fifteen new cards added to the animalCards deck - All categories are full, except for the reptiles & amphibians [burnsteem100]@remlaps-lite
- Juvenile Bald Eagles at the Conowingo Dam on October 17, 2026@remlaps
- Reblog: OSIRIS-REx probe lands on asteroid Bennu and collects a small sample@remlaps-lite
Great article!