0

Hello everyone,

I am working on a dictionary application implementation. I have question about a string pattern matching algorithm implementation. In this algorithm, * can be used to match any sequence of characters. The input is string s1 and string s2, the algorithm using s2 to match s1, and the output is the number of possibility matching.

For example, s1 = ABC, s2 = AC*, output is 0;

For example, s1 = ABC, s2 = A*C, output is 1;

For example, s1 = AB, s2 = ***, output is 6 (AB,NULL,NULL

NULL,AB.NULL

NULL,NULL,AB

NULL,A,B

A,NULL,B

A, B, NULL);

Does anyone know what is the most efficient implementation? Currently, I only have a brute-force implementation.

thanks in advance & happy new year,

George