Data Structure for NFA Representation

In my lexical analyzer generator, I use the McNaughton and Yamada algorithm to build NFA and one of its properties, which goes from form I to J, marked char at position J.

So, each NFA node can be represented simply as a list of the following possible states.

What data structure is best for storing this type of data? It should provide a quick search for all possible states and use less space, but insertion time is not so important.

+3
source share
1 answer

I understand that you want to encode a graph where nodes are states and edges are transitions, and where each edge is marked with a symbol. It is right?

, , .

- , : , , . , , : , , . , ; , ( - ), , ( - ). ?

-, , . , ; . ( ), , . .

, , -, : , , , , , , -.

- , , , - , , , . , . - , -, - , , - .

+2

Source: https://habr.com/ru/post/1782926/


All Articles