import java.text.*; public class Alignment { public static final char GAP = '-'; // Data. static int numLetters = 4; static char[] alphabet = {'A', 'C', 'G', 'T'}; // match[i][j] = cost of matching alphabet[i] with alphabet[j]. static double[][] match = { {1, -1, -1, -1}, {-1, 1, -1, -1}, {-1, -1, 1, -1}, {-1, -1, -1, 1}, }; // Constant gap score. static double[] gapScore1 = {-2, -2, -2, -2}; static double[] gapScore2 = {-2, -2, -2, -2}; // The D array. static double[][] D; public static void align (String inputStr1, String inputStr2) { // INSERT YOUR CODE HERE. // At the end, after alignment: System.out.println ("Alignment (score: " + D[inputStr1.length()][inputStr2.length()] + ")"); } /////////////////////////////////////////////////////////////////// public static void main (String[] argv) { test1(); test2(); test3(); } static void test1 () { String str1 = "ACA"; String str2 = "ACC"; System.out.println ("Input strings: str1=" + str1 + " str2=" + str2 + " optimal value = 1.0"); align (str1, str2); } static void test2 () { String str1 = "ACA"; String str2 = "CACA"; System.out.println ("Input strings: str1=" + str1 + " str2=" + str2 + " optimal value = 1.0"); align (str1, str2); } static void test3 () { String str1 = "ACA"; String str2 = "CGACAC"; System.out.println ("Input strings: str1=" + str1 + " str2=" + str2 + " optimal value = -3.0"); align (str1, str2); } }