Forums Register Login

A DFA string search algorithm

+Pie Number of slices to send: Send
JavaProjMy teacher gave me a project i can't understand ho does it work or how to solve it even he want meto enter a DFA and then enter a text and see if it's accepted or not and the table is from the file that i loaded from my pc as i see now i don't know how to begin what the first step how does all of these things work just can't understand how con we tell him that if we gave it a then go to q1 from example all that logic can't imagine it if anybody have ever seen these thing just the steps or tell what is this how can i relate them to each other "the logic".
thanks rom now
+Pie Number of slices to send: Send
Hi Abeer,

An easy way to model a DFA is to create an object for each state, and that state keeps track of what symbols lead to what other states. Then, you can give them a method that takes a symbol, and returns the correct state it leads to. Finally, you can give them a method that takes a String, and recursively resolves the symbols in the String one at a time.

Start by creating a class called State, and giving it a way to add transitions between it and another state.
+Pie Number of slices to send: Send
For a very readable introduction to regular expressions and all things FSA's, see here:

http://math.hws.edu/FoundationsOfComputation/

especially chapter 3.

Greetings,
Piet
+Pie Number of slices to send: Send
As an aside, it's quite hard to follow what you write - please get in the habit of using punctuation and capitalization. A forum is not a text message, and you should try to make it easy for people to help you.
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 850 times.
Similar Threads
help me solve this
Quit tableviews/whole app on clicking quit button
Websphere ESB and Process Server
java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
how to get URL of a image in sd card
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 18:53:06.