CPP program for Finite Automata Pattern searching Algorithm
#include <bits/stdc++.h> NEW_LINE using namespace std ; #define NO_OF_CHARS  256  NEW_LINE int getNextState ( string pat , int M , int state , int x ) {