Rabu, 06 Juni 2012

Program Fungsi Pinggiran (C++)

#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>

using namespace std;

void FailureFunction(char P[], int F[],int m){
    int i,j;
    F[0]=0;    //  assignment is important!
    j=0;
    i=1;
    while(i<m){ // that i is less than the length of pattern
        if(P[i]==P[j]){
            F[i]=j+1;
            i++;
            j++;

Twitter Delicious Facebook Digg Stumbleupon Favorites More

 
Design by Free WordPress Themes | Blogger Theme by Lasantha - Premium Blogger Templates | Affiliate Network Reviews