go to previous page   go to home page   go to next page

Answer:

table[2]['b'] = 0;

addTrans()

It is convenient to have a method that sets the correct entry in the table for a transition. Here is the pseudocode:

addTrans( currentState, input, nextState )
{
  transition[currentState][input] = nextState;  
}

The actual code has some error checking and implementation logic. (See the full Java implementation, below.)


QUESTION 6:

How many final states are allowed in an automaton?