Hi all!
I am trying to implement the Boyer Moore Horspool algorithm and having trouble with the following function:
void shiftTable(char* pat, int num){
int i;
num= strlen(pat);
for(i=0;i<10;i++)
table=num;
for(int j=0; j<pNum; j++)
table[pat[j]]=num-(1+j);// int table[10]
}
what I am trying is to put num-1-j into table using the position of pat[j] as index i.e, for pat="BOY", table[0] should have 2(num-1-j);
Any help would be appreciated. Thanks in advance
I am trying to implement the Boyer Moore Horspool algorithm and having trouble with the following function:
void shiftTable(char* pat, int num){
int i;
num= strlen(pat);
for(i=0;i<10;i++)
table=num;
for(int j=0; j<pNum; j++)
table[pat[j]]=num-(1+j);// int table[10]
}
what I am trying is to put num-1-j into table using the position of pat[j] as index i.e, for pat="BOY", table[0] should have 2(num-1-j);
Any help would be appreciated. Thanks in advance