Suppose we have the following method (it is in c code):
const char *bitap_search(const char *text, const char *pattern)
My question is how can I compare text and pattern if they are char
? This method is like a substring problem but I am confused a bit can I write in term of char such code?
if (text[i]==pattern[i])
?
look i am interesting at this algorithm in java
http://en.wikipedia.org/wiki/Bitap_algorithm
how implement this in java?
R = malloc((k+1) * sizeof *R);
and please help me to translate this code in java so we have two string text? like "i like computer it is very important" and patter string " computer it is very"? can anybody explain me what we have instead of char?