Understanding of DFA and NFA and the difference between them

Source: Internet
Author: User

A program to be converted into a lexical analyzer, the task of the lexical analyzer is to convert the character stream into lexical notation flow, the core of the transformation is a poor automaton representation, there is a poor self-motive and state conversion diagram a bit similar, but it is not a graph, but a recognizer, it is the character of each input to identify and judge, In order to determine the final state or state set and path that it can reach, there are two kinds of poor automata, namely, the uncertain have the poor automaton NFA and the deterministic finite automaton DFA;

The NFA, if an input symbol, can get two or more than two possible states, that is, the possible state of the obtained is uncertain; if an input symbol is used, the DFA can only get a single possible state.

The main differences that NFA can convert into Dfa,nfa and DFA are:

1) The DFA does not enter the conversion action above the empty string;

2) for DFA, a specific symbol input, has and can only get a state, and the NFA is likely to get a state set;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.