Skip to content

Latest commit

 

History

History
25 lines (17 loc) · 749 Bytes

File metadata and controls

25 lines (17 loc) · 749 Bytes

Knuth-Morris-Pratt Application

Implementation of the text/string searching and matching algorithm KMP Knuth-Morris-Pratt in visual C#.

Prefix Table Render Application

This program renders the prefix function in a table fashion showing the index, string and the prefix value for each character This will use the Knuth-Morris-Pratt to produce a prefix table for matching it with the pattern.

A sample run of the program on the pattern “ABXYABXZ” produces the following output:

i si pi
1 A 0
2 AB 0
3 ABX 0
4 ABXY 0
5 ABXYA 1
6 ABXYAB 2
7 ABXYABX 3
8 ABXYABXZ 0