Programming Project # 3

(due Friday May 9th)

Pattern Searching in Strings

Implement the Boyer-Moore Algorithm described in the hand-out and which will be discussed in class.

This program should be written in C and will find a pattern string (of maximum length 6) in a source string (limited to 100 characters).

Apply your program to find the pattern string, "ABACAB" in the source string, "BCACABDCABEFGAFEBCABACABACABDEFABCD"

Your program should return the position on the source string where the first character in the pattern string is located when a match is found, or NIL otherwise. You will need to make up the skip array by hand, and can simply give it to your program as an array (ie your program does not need to compute the skip array, it just has to use it).