Skip to content

Instantly share code, notes, and snippets.

@pheeque
pheeque / kmp.cpp
Last active December 28, 2018 09:12 — forked from YDrall/kmp.cpp
c++ implementation of kmp string matching algorithm.
#include<iostream>
#include<string>
using namespace std;
int *pre_kmp(string pattern)
{
int size = pattern.size();
int *pie=new int [size];
pie[0] = 0;