LEXICAL ANALYSIS
REGULAR EXPRESSIONS AND FINITE AUTOMATA
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
using PDA
|
|
making final state as non-final
|
|
making final as starting state and starting state as final state
|
|
None of the mentioned
|
Detailed explanation-1: -To write the reverse of a DFA, Change all the initial states to final and the final ones to initials(for the later, if there are multiple final states, use a new state and use null transitions to each of them).
Detailed explanation-2: -Please note: A DFA which accepts nothing does not even accept . For example, below DFA has initial state as final state, so it accepts atleast . Hence it is not a DFA which accepts empty language. Empty language means nothing is accepted.
Detailed explanation-3: -The reverse of a string changes the order of strings. The reverse of a string can be obtained by writing the letters of a string in reverse order.
Detailed explanation-4: -Make final state as initial state. If there are more than 1 final state, then make a new start state with epsilon transitions to these states. Change all initial states to final states. Reverse the direction of edges. 07-Jan-2018