11.10.2013 Aufrufe

Algorithmen und Datenstrukturen Vorlesungsskript WS/SS 99-00

Algorithmen und Datenstrukturen Vorlesungsskript WS/SS 99-00

Algorithmen und Datenstrukturen Vorlesungsskript WS/SS 99-00

MEHR ANZEIGEN
WENIGER ANZEIGEN

Sie wollen auch ein ePaper? Erhöhen Sie die Reichweite Ihrer Titel.

YUMPU macht aus Druck-PDFs automatisch weboptimierte ePaper, die Google liebt.

12. Ausgesuchte algorithmische Probleme<br />

a b a a b a b a a b a c a b a a b a b a a b a a b<br />

a b a a b a b a a b a a b<br />

a b a a b a b a a b a c a b a a b a b a a b a a b<br />

a b a a b a b a a b a a b<br />

a b a a b a b a a b a c a b a a b a b a a b a a b<br />

a b a a b a b a a b a a b<br />

a b a a b a b a a b a c a b a a b a b a a b a a b<br />

Beispiel KMP II<br />

¯ erster Mismatch: , , ×ÓÖÖ ℄ <br />

führt zu ×ÓÖÖ ℄ <strong>und</strong> ×ÓÖÖ ℄ .<br />

¯ zweiter Mismatch: , , ×ÓÖÖ℄ <br />

führt zu ×ÓÖÖ℄ <strong>und</strong> ×ÓÖÖ℄ .<br />

¯ dritter Mismatch: , , ×ÓÖÖ℄ <br />

führt zu ×ÓÖÖ℄ <strong>und</strong> ×ÓÖÖ℄ .<br />

¯ vierter Mismatch: , , ×ÓÖÖ ℄ <br />

führt zu ×ÓÖÖ ℄ <strong>und</strong> ×ÓÖÖ ℄ .<br />

Boyer-Moore<br />

a b a c a a b a c c a b a c a b a a b b<br />

a b a c a b<br />

a b a c a b<br />

Prinzip von Boyer-Moore<br />

4<br />

1<br />

3<br />

2<br />

a b a c a b<br />

a b a c a b<br />

¯ Vergleich nun von rechts nach links<br />

¯<br />

248<br />

9<br />

8<br />

5<br />

7<br />

15<br />

6<br />

a b a c a b<br />

Überlegungen: Shift-Tabelle ℄ beinhaltet sichere Verschiebung falls ÔØ℄ <br />

ØÜØ ℄ <strong>und</strong> ÔØ Ñ℄ ØÜØ Ñ ℄<br />

14<br />

13<br />

12<br />

11<br />

10

Hurra! Ihre Datei wurde hochgeladen und ist bereit für die Veröffentlichung.

Erfolgreich gespeichert!

Leider ist etwas schief gelaufen!