0

hello guys, i need ur help in converting NFA to DFA

DFA Algorithm :

s <- s0              { start from the initial state }
c <- nextchar        { get the next character from the input string }
while (c != eos) do     { do until the end of the string }
    begin
           s <- move(s,c)    { transition function }
           c <- nextchar
    end
if (s belongs F) then       { if s is an accepting state }
    return “yes”
else
    return “no”

NFA Algorithm:

S <- e-closure({q0}) 
c <- nextchar
while (c != eos) {
    begin
          s <- e-closure(move(S,c))  { set of all states can be accessible                       from a state in S by a transition on c }
            c <- nextchar        
    end
if (S intersect F != 0) then            { if S contains an accepting state }
    return “yes”
else
    return “no”

Edited by Reverend Jim: Fixed formatting

2
Contributors
2
Replies
4
Views
7 Years
Discussion Span
Last Post by em-kay
0

Have you done a site search? I seem to remember seeing this question before...

yes i did , but i havent found any code in C++

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.