Knuth morris pratt
Sponsored Links
This presentation is the property of its rightful owner.
1 / 12

Knuth-Morris-Pratt PowerPoint PPT Presentation


  • 48 Views
  • Uploaded on
  • Presentation posted in: General

Knuth-Morris-Pratt. KMP algorithm. [over binary alphabet] Build DFA from pattern. Run DFA on text. Search Text. a. a. a. b. a. a. b. a. a. a. b. a. a. b. a. a. a. b. a. a. a. a. a. b. a. b. 0. 1. 3. 4. 2. 5. 6. accept state. b. b. b.

Download Presentation

Knuth-Morris-Pratt

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


Knuth-Morris-Pratt

  • KMP algorithm. [over binary alphabet]

    • Build DFA from pattern.

    • Run DFA on text.

Search Text

a

a

a

b

a

a

b

a

a

a

b

a

a

b

a

a

a

a

a

b

a

a

a

a

a

b

a

a

a

b

a

a

a

a

a

b

a

b

0

1

3

4

2

5

6

accept state

b

b

b


  • Login