We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#define NO_OF_CHARS 256
char b[] = "ABGAA67"; char a[] = "AG7"; int aASCII[NO_OF_CHARS]; int bASCII[NO_OF_CHARS]; for (int i = 0; i < NO_OF_CHARS; i++) { aASCII[i] = -1; bASCII[i] = -1; } for (int i = 0; i < strlen(a); i++) { aASCII[(int) a[i]] = i; } for (int i = 0; i < strlen(b); i++) { bASCII[(int) b[i]] = i; } int findCount = 0; for (int i = 0; i < NO_OF_CHARS; i++) { if (aASCII[i] != -1 && bASCII[i]!=-1) { findCount++; } } if (findCount == strlen(a)) { printf("find"); }
Reference:https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm http://www.geeksforgeeks.org/pattern-searching-set-7-boyer-moore-algorithm-bad-character-heuristic/
The text was updated successfully, but these errors were encountered:
No branches or pull requests
#define NO_OF_CHARS 256
Reference:https://en.wikipedia.org/wiki/Boyer%E2%80%93Moore_string_search_algorithm
http://www.geeksforgeeks.org/pattern-searching-set-7-boyer-moore-algorithm-bad-character-heuristic/
The text was updated successfully, but these errors were encountered: