Package org.ddolib.examples.lcs
Class LCSState
java.lang.Object
org.ddolib.examples.lcs.LCSState
Represents the state of a node in the Longest Common Subsequence (LCS) problem.
In this problem, the state is defined by the current position in each of the strings being compared. Each position indicates how many characters of that string have been processed.
This state is used by search and optimization algorithms to track progress along the strings. It is immutable in the sense that new states are created rather than modifying existing ones.
-
Method Summary
-
Method Details
-
hashCode
public int hashCode()Returns a hash code for this state, based on the positions in all strings. -
equals
Checks equality between this state and another object. Two states are equal if their position arrays are identical. -
toString
Returns a string representation of the state.The positions in each string are shown as an array.
-