backtrackLCS {runibic} | R Documentation |
This function retrieves the Longest Common Subsequence (LCS) between two integer vectors by backtracking the matrix obtained with dynamic programming.
backtrackLCS(x, y)
x |
an integer vector |
y |
an integer vector |
an integer vector containing the the Longest Common Subsequence (LCS) between vectors x and y (i.e. the values that appear in both x and y in the same order)
runibic
pairwiseLCS
calculateLCS
A <- c(1, 2, 3, 4, 5) B <- c(1, 2, 4) backtrackLCS(A, B)