Пример #1
0
int main()
{
	char *text, *pattern;
	size_t length_of_text = 128,
		length_of_pattern = 128;
	int q, d;

	printf("Enter Text: ");
	text = InputString(stdin, &length_of_text);

	printf("Enter Pattern: ");
	pattern = InputString(stdin, &length_of_pattern);

	printf("Enter d: ");
	scanf("%d", &d);

	printf("Enter q: ");
	scanf("%d", &q);

	RabinKarpMatcher(text, pattern, length_of_text - 1, length_of_pattern - 1, d, q);

	free(text);
	free(pattern);

	return 0;
}
Пример #2
0
int Matcher(char* haystack, char* needle)
{
	return RabinKarpMatcher(haystack, needle, 128, 6999997);
}