Documentation
¶
Overview ¶
package lcs provides functions to calculate Longest Common Subsequence (LCS) values from two arbitrary arrays.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IndexPair ¶
IndexPair represents an pair of indeices in the Left and Right arrays found in the LCS value.
type Lcs ¶
type Lcs interface {
// Values calculates the LCS value of the two arrays.
Values() (values []interface{})
// ValueContext is a context aware version of Values()
ValuesContext(ctx context.Context) (values []interface{}, err error)
// IndexPairs calculates paris of indices which have the same value in LCS.
IndexPairs() (pairs []IndexPair)
// IndexPairsContext is a context aware version of IndexPairs()
IndexPairsContext(ctx context.Context) (pairs []IndexPair, err error)
// Length calculates the length of the LCS.
Length() (length int)
// LengthContext is a context aware version of Length()
LengthContext(ctx context.Context) (length int, err error)
// Left returns one of the two arrays to be compared.
Left() (leftValues []interface{})
// Right returns the other of the two arrays to be compared.
Right() (righttValues []interface{})
}
Lcs is the interface to calculate the LCS of two arrays.
Click to show internal directories.
Click to hide internal directories.