Skip to content
longest common subsequence in Java
Java
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
gradle/wrapper
src
test_sequences
.gitignore
README.md
build.gradle
gradlew
gradlew.bat
settings.gradle

README.md

#LCS Finding the Longest Common Subsequence in a Directed Acyclic Graph written in Java

Read

https://scottjulian.com/finding-the-longest-common-subsequence/

Run Tests

./gradlew test

Example

Given Sequences:

abcde
bcaed
adbce

Output:

all pairs:
  (a b) (a c) (a d) (a e) (b c) (b d) (b e) (c d) (c e) (d e)
  (b c) (b a) (b e) (b d) (c a) (c e) (c d) (a e) (a d) (e d)
  (a d) (a b) (a c) (a e) (d b) (d c) (d e) (b c) (b e) (c e)

intersected pairs:
  (a d) (a e) (b c) (b e) (c e)

topological order of nodes:
  abdec

longest common subsequence:
  b c e
You can’t perform that action at this time.