// ■文字列照合の力任せ法, KMP法, BMP法の比較 // text1に照合対象の文字列 // text2に照合パターン // text3にKMP法、BMP法によるスキップ表 // text4に下記プログラムのp1の変化 // を表示します // // button1, button2, button3を配置し、 // Clickイベントを指定します。 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace strSearch { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private int brute(string str, string pat) { int p1,p2,N1,N2; p1=p2=0;N1=str.Length; N2=pat.Length; string S = ""; int cnt = 0; while(p1