Question: ( c ) The following recursive algorithm uses a slightly different idea. Its correctness relies on the fact that a string w 1 w 2
c The following recursive algorithm uses a slightly different idea. Its correctness relies on the
fact that a string if and only if there exists an index iindots, such
that and inL. Explain why does not run in polynomial time.
d The main issue with the recursive algorithm in part c is that it for each prefix of
it keeps repeating the work of checking whether that prefix is in Wouldn't it be great
if for each you only had to check whether is in once?
It turns out you can, and this forms the basis of an actual polynomial time algorithm. Think
of filling out an array dots, where each cell contains the answer to the question,
is Design an algorithm that systematically fills in this array and uses
it to determine whether Briefly explain why your algorithm runs in polynomial time,
and how it allows you to conclude that is closed under the star operation.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
