String Matching Algorithm Time Complexity