Question: One student suggested the following algorithm to test a string of a's and b's to see if it is a word in S*. where S
One student suggested the following algorithm to test a string of a's and b's to see if it is a word in S*. where S = {aa ba aba abaab}. Step 1, cross off the longest set of characters from the front of the string that is a word in S. Step 2, repeat step 1 until it is no longer possible. If what remains is the string A. the original string was a word in S*. If what remains is not A (this means some letters are left, but we cannot find a word in S at the beginning), the original string was not a word in S*. Find a string that disproves this algorithm.
Step by Step Solution
3.40 Rating (150 Votes )
There are 3 Steps involved in it
The string that disproves this algorithm is as follows i abaab The string i... View full answer
Get step-by-step solutions from verified subject matter experts
