How should I implement this HashMap's equals and hashCode methods to represent an automaton state?

Go for the 2nd one, easier and works better than 1, unless you want to take care of the duplicated states.

If the automaton is a DFA, then one can use the Accessing String to ID the field. An accessing String is any string that could be used to reach the state from the start state. One will have to build the string while building the DFA, however, it won't add more time complexity.(Yes, one then needs to hashcode/equal the string) Or actually, ID the states by an increasing serial number/string should work for all automaton.

Then hashcode/equal based on the ID. Go for the 2nd one, easier and works better than 1, unless you want to take care of the duplicated states. Yes, you need the hashcode and equals for a user defined type to work with hash.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions