CSL201: Assignment 3

Due Date : March 17, 2013

Pattern Matching with wildcards

In this assignment, you will learn to implement suffix trees and use them for pattern matching. You are given a long text T containing English characters, numbers (and other special characters like blank, etc.). Given a string P, you have to find ALL occurences of P in T, i.e., you have to mention the locations in T where P occurs. Recall that we say P occurs in T if there is a sequence of consecutive characters in T which is same as P. To make your program more powerful, the pattern can contain the following wildcards : You can assume for the sake of simplicity that P contains at most one * character. You can also assume that T does not contain the characters * and ?. Your implementation should be as efficient as possible. The text T will be given as a file. So you should use file input/output for reading T.