Preprocessing
The function occ required for the bad-character heuristics is computed slightly different as in the Boyer-Moore algorithm.
For every alphabet symbol a, the function value occ(p, a) is equal to the rightmost position of a in p0…pm-2, or -1, if a does not occur at all.
www.iti.fh-flensburg.deVorlauf
Die für die Schlechtes-Zeichen-Strategie benötigte Occurrence-Funktion occ wird geringfügig anders berechnet als beim Boyer-Moore-Algorithmus.
Für jedes Alphabetzeichen a ist occ(p, a) die Position seines letzten Vorkommens in p0…pm-2, bzw. -1, falls das Zeichen darin überhaupt nicht vorkommt.
www.iti.fh-flensburg.deSoftware - Practice and Experience 10, 501-506 ( 1980 )
The Boyer-Moore algorithm uses two heuristics in order to determine the shift distance of the pattern in case of a mismatch:
the bad-character and the good-suffix heuristics.
www.iti.fh-flensburg.desiehe Definition siehe Definition
Der Boyer-Moore-Algorithmus verwendet zwei Strategien, um die Verschiebung des Musters bei einem Mismatch zu bestimmen:
die Schlechtes-Zeichen- und die Gutes-Ende-Strategie.
www.iti.fh-flensburg.deThe pattern can be shifted until the rightmost occurrence of b in the pattern matches the text character b, where the occurence at the last position of the pattern does not count.
Like the Boyer-Moore algorithm, the Horspool algorithm assumes its best case if every time in the first comparison a text symbol is found that does not occur at all in the pattern.
Then the algorithm performs just O(n/m) comparisons.
www.iti.fh-flensburg.deDer Horspool-Algorithmus ( b ) ermittelt die Schiebedistanz aufgrund des letzten Vorkommens von b, wobei das Vorkommen des b an der letzten Position des Musters nicht mitzählt.
Auch im Horspool-Algorithmus tritt der günstigste Fall ein, wenn jedesmal beim ersten Vergleich ein Textzeichen gefunden wird, das im Muster überhaupt nicht vorkommt.
Dann benötigt der Algorithmus nur O(n/m) Vergleiche.
www.iti.fh-flensburg.deVorlauf
Die für die Schlechtes-Zeichen-Strategie benötigte Occurrence-Funktion occ wird geringfügig anders berechnet als beim Boyer-Moore-Algorithmus.
Für jedes Alphabetzeichen a ist occ(p, a) die Position seines letzten Vorkommens in p0…pm-2, bzw. -1, falls das Zeichen darin überhaupt nicht vorkommt.
www.iti.fh-flensburg.dePreprocessing
The function occ required for the bad-character heuristics is computed slightly different as in the Boyer-Moore algorithm.
For every alphabet symbol a, the function value occ(p, a) is equal to the rightmost position of a in p0…pm-2, or -1, if a does not occur at all.
www.iti.fh-flensburg.desiehe Definition siehe Definition
Der Boyer-Moore-Algorithmus verwendet zwei Strategien, um die Verschiebung des Musters bei einem Mismatch zu bestimmen:
die Schlechtes-Zeichen- und die Gutes-Ende-Strategie.
www.iti.fh-flensburg.deSoftware - Practice and Experience 10, 501-506 ( 1980 )
The Boyer-Moore algorithm uses two heuristics in order to determine the shift distance of the pattern in case of a mismatch:
the bad-character and the good-suffix heuristics.
www.iti.fh-flensburg.deMöchtest du ein Wort, eine Phrase oder eine Übersetzung hinzufügen?
Sende uns gern einen neuen Eintrag.