
普京,一个中国人非常熟悉的名字,在他卸任之后,不尽俄罗斯举国上下掀起了一股普京热,在邻居中国,在一个曾经耻笑过那个倒下的巨人的国家,更是掀起了一股普京浪潮...Hidden by author.
Reference:http://news.xinhuanet.com/world/2008-03/11/content_7765251.htm

Boyer-Moore algorithm | |
The algorithm of Boyer and Moore [BM 77] compares the pattern with the text from right to left. If the text symbol that is compared with the rightmost pattern symbol does not occur in the pattern at all, then the pattern can be shifted by m positions behind this text symbol. The following example illustrates this situation.
Example:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... |
|---|---|---|---|---|---|---|---|---|---|---|
| a | b | b | a | d | a | b | a | c | b | a |
| b | a | b | a | c | ||||||
| b | a | b | a | c |
The first comparison d-c at position 4 produces a mismatch. The text symbol d does not occur in the pattern. Therefore, the pattern cannot match at any of the positions 0, ..., 4, since all corresponding windows contain a d. The pattern can be shifted to position 5.
The best case for the Boyer-Moore algorithm is attained if at each attempt the first compared text symbol does not occur in the pattern. Then the algorithm requires only O(n/m) comparisons.
This method is called bad character heuristics. It can also be applied if the bad character, i.e. the text symbol that causes a mismatch, occurs somewhere else in the pattern. Then the pattern can be shifted so that it is aligned to this text symbol. The next example illustrates this situation.
Example:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... |
|---|---|---|---|---|---|---|---|---|---|---|
| a | b | b | a | b | a | b | a | c | b | a |
| b | a | b | a | c | ||||||
| b | a | b | a | c |
Comparison b-c causes a mismatch. Text symbol b occurs in the pattern at positions 0 and 2. The pattern can be shifted so that the rightmost b in the pattern is aligned to text symbol b.
Sometimes the bad character heuristics fails. In the following situation the comparison a-b causes a mismatch. An alignment of the rightmost occurence of the pattern symbol a with the text symbol a would produce a negative shift. Instead, a shift by 1 would be possible. However, in this case it is better to derive the maximum possible shift distance from the structure of the pattern. This method is called good suffix heuristics.
Example:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... |
|---|---|---|---|---|---|---|---|---|---|---|
| a | b | a | a | b | a | b | a | c | b | a |
| c | a | b | a | b | ||||||
| c | a | b | a | b |
The suffix ab has matched. The pattern can be shifted until the next occurence of ab in the pattern is aligned to the text symbols ab, i.e. to position 2.
In the following situation the suffix ab has matched. There is no other occurence of ab in the pattern.Therefore, the pattern can be shifted behind ab, i.e. to position 5.
Example:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... |
|---|---|---|---|---|---|---|---|---|---|---|
| a | b | c | a | b | a | b | a | c | b | a |
| c | b | a | a | b | ||||||
| c | b | a | a | b |
In the following situation the suffix bab has matched. There is no other occurence of bab in the pattern. But in this case the pattern cannot be shifted to position 5 as before, but only to position 3, since a prefix of the pattern (ab) matches the end of bab. We refer to this situation as case 2 of the good suffix heuristics.
Example:
| 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | ... |
|---|---|---|---|---|---|---|---|---|---|---|
| a | a | b | a | b | a | b | a | c | b | a |
| a | b | b | a | b | ||||||
| a | b | b | a | b |
The pattern is shifted by the longest of the two distances that are given by the bad character and the good suffix heuristics.
Reference:
http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/bmen.हतं
http://www.inf.fh-flensburg.de/lang/algorithmen/pattern/kmpen.हतं

My name is Liu Cong, an overseas student from china. On the 22th December, 2006, I moved to Unit 2,
So, I desire the police to expel them from our unit.
Thank you for your consideration.
Yours sincerely,
Liu Cong

Dear classmates, We have not seen fora long time since we graduated from REW. Next week, there will be a long break, so i have contacted Nathan, he very missed everyone of u. So we decide to have a picnic during the Eastern Break, the place is Botanic Garden. Nathan will come with his families. We need to bring our own food and drink to share, just like the riding along Yarra River last time. (No riding this time). So if u are interested in this, and not busy during the break, i hope everyone can come. Don't u think the friendship between us is deeper than between the university classmates. The time we have not decided, coz we have to discuss with u, so please do reply me and tell me your available time. After that, i will inform u the exact time and detail in the middle of next week. Miss u! At last, no matter u will come or not, please reply me, and i will know u have received this invitation Cheers! Yours, Jerry |