yea, it at table[pattern[j]]= num-1-j.
I think the problem is that pattern[j] return an index of type char and table is of type int.
Any suggestions on other ways of accomplishing this?
Thanks HyperEngineer!!!
Corrections: pattern always contains num < 10;
int table[10];
num is the number of char in pattern
void shiftTable(char* pattern, int num){
int i;
num= strlen(pattern);
for(i=0;i<10;i++)
table[i]=num;
for(int j=0; j<num; j++)...
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[i]=num;
for(int j=0; j<pNum; j++)
table[pat[j]]=num-(1+j);// int table[10]
}
what I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.