Skip to content
Related Articles
Get the best out of our app
GFG App
Open App
geeksforgeeks
Browser
Continue

Related Articles

GATE | GATE CS 2010 | Question 65

Improve Article
Save Article
Like Article
Improve Article
Save Article
Like Article

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

My Personal Notes arrow_drop_up
Last Updated : 14 Feb, 2018
Like Article
Save Article
Similar Reads