説æ è¤æ°ã®ãã¿ã¼ã³æååãããªãéåã¨é·ãæååãä¸ããããï¼é·ãæååã«å¯¾ãã¦ããããããã¿ã¼ã³æååããã¹ã¦æ±ããã¢ã«ã´ãªãºã ã Aho Corasick ã§ããï¼ããã¯è¤æ°ãã¿ã¼ã³æååãããããã trie ã«å¤æãã¦ãã KMP ãå®è¡ãï¼ãã¿ã¼ã³ãããã³ã°ã»ãªã¼ãããã³ãæ§æãã¦ãããã¨ã«ãªãï¼ è©³ããã¯é©å½ãªææ¸ã http://www.cs.uku.fi/~kilpelai/BSA05/lectures/slides04.pdf ãªã©ãåèã®ãã¨ï¼ è¨ç®é æ§ç¯ O(m)ï¼ æ¤ç´¢ O(n + m)ï¼ ãã ã m ã¯ãã¿ã¼ã³ã®æååé·ã®ç·åï¼n ã¯æ¤ç´¢ããã¹ãé·ï¼ 使ãæ¹ struct PMA; ãé©å®è¨å®ã®ãã¨ï¼ buildPMA(char *p[], int m) 0 ... m-1 ã®è¤æ°ã®æ¤ç´¢ãã¿ã¼ã³ããï¼ãã¿ã¼ã³ãããã³ã°ã»ãªã¼ãããã³ãæ§ç¯ããï¼ match(c
ãªãªã¼ã¹ãé害æ å ±ãªã©ã®ãµã¼ãã¹ã®ãç¥ãã
ææ°ã®äººæ°ã¨ã³ããªã¼ã®é ä¿¡
å¦çãå®è¡ä¸ã§ã
j次ã®ããã¯ãã¼ã¯
kåã®ããã¯ãã¼ã¯
lãã¨ã§èªã
eã³ã¡ã³ãä¸è¦§ãéã
oãã¼ã¸ãéã
{{#tags}}- {{label}}
{{/tags}}