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

Knuth-Morris-Pratt PowerPoint PPT Presentation


  • 41 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

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 pratt1

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 pratt2

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 pratt3

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 pratt4

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 pratt5

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 pratt6

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 pratt7

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 pratt8

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 pratt9

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 pratt10

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 pratt11

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