Welcome to my site
 
Study-Related
Telematik
INM
BS1
Java-Applets
Books
Private
Curriculum Vitae
Photo-Gallery
Guestbook
Search Engines
What's New?
Contact Me
You are here:   HOME  >  Study-Related  >  Java-Applets  >  LCS

Longest Common Subsequence

version 2.0.1

Java-Applet: Whoops, this browser is not Java enabled!

 

Infos:
  • Die Eingabe/Änderung eines Strings muss entweder mit der ENTER-Taste oder durch Init/Reset bestätigt werden.
  • Die maximale Eingabelänge der Strings beträgt 14. Jede längere Eingabe wird abgeschnitten.
Pseudocode:

/* Initialize */
for i := 0 to m do l[i,0] := 0 od
for j := 1 to n do l[0,j] := 0 od
/* Calculate l[...]: */
for i := 1 to m do
    for j := 1 to n do
        if String1[i] = String2[j] then
            l[i,j] := l[i-1,j-1] + 1          /* Case 1 */
        else
            l[i,j] := max(l[i-1,j],l[i,j-1])  /* Case 2 */
        fi
        WRITELN("Actual Length:",l[i,j])
    od
od