Difference between revisions of "Finite State Machine"

From Progzoo
Jump to: navigation, search
(Even Binary Numbers)
(Even Binary Numbers)
Line 46: Line 46:
 
       i++;
 
       i++;
 
     }
 
     }
 +
    return state==States.A;
 +
  }
 +
}
 +
]]></prog>
 +
</question>
 +
 +
 +
==Even Binary Numbers - Absracted==
 +
 +
<question className='EvenBinary'>
 +
<prog><![CDATA[
 +
import java.util.TreeMap;
 +
public class EvenBinary{
 +
 +
  public static void main(String[] args) {
 +
    String [] ls = {"10", "111", "01"};
 +
    for (String s : ls)
 +
      System.out.printf("%10s, %s\n", s,sm(s));
 +
}
 +
 +
  public enum States {START,FAIL,A,B};
 +
  public static boolean sm(String s)
 +
  {
 +
    States state = States.START;
 +
    TreeMap<States,TreeMap<char,States>> =
 +
      new TreeMap<States,TreeMap<char,States>>();
 
     return state==States.A;
 
     return state==States.A;
 
   }
 
   }

Revision as of 20:38, 16 February 2012

Finite State Machines

Even Binary Numbers


[Font] [Default] [Show] [Resize] [History] [Profile]


Even Binary Numbers - Absracted


[Font] [Default] [Show] [Resize] [History] [Profile]

What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]


What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]

What is the function


[Font] [Default] [Show] [Resize] [History] [Profile]