GATE | GATE CS 2010 | Question 65

Let w be any string of length n is {0,1}*. Let L be the set of all substrings of w. What is the minimum number of states in a non-deterministic finite automaton that accepts L?
(A) n-1
(B) n
(C) n+1
(D) 2n-1


Answer: (C)

Explanation: We need minimum n+1 states to build NFA that accepts all substrings of a binary string. For example, following NFA accepts all substrings of “010″ and it has 4 states.

NFA_FOR_SUBSTRINGS-300x90

Quiz of this Question




Recommended Posts:



0 Average Difficulty : 0/5.0
No votes yet.