Question: 2. Pattern Matching (25 marks) (a) Construct the finite state automaton (the transition function 8) to find matches of the pattern P = aba ab

2. Pattern Matching (25 marks) (a) Construct the finite state automaton (the transition function 8) to find matches of the pattern P = aba ab in the text T in the alphabet {a, b}. How the automaton will be changed if the alphabet of the next will be {a,b,c}? Simulate the pattern matching algorithm for the text T = aba ababa aba abcbcbcba. (7 marks) (b) Construct the a function for the pattern P = abaababaabaab. How the a function will be changed if the first symbol a in P will be replaced by the symbol c? How the n function will be changed if the first symbol a in P will be replaced by the symbol b? (8 marks) (c) How the function I will be used in the KMP algorithm? What is the running time of the KMP algorithm? (5 marks) (d) Computing the position of the first symbol 1 in a sequence of O's and 1's can be solved in linear time and not better than linear using sequential algorithms. How this problem can be solved in sublinear time with concurrent write PRAM model
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
