rkz
public java v1 · immutable HashMap key = new HashMap(); int bestMatch = -1; double smallestDelta; for (int i=0;i<26;i++) { smallestDelta = 1; //impossibly large number to start off with. for (int j=0;j<26;j++){ if (delta(cipherFreqArray[i],engfreqs[j]) < smallestDelta) { smallestDelta = delta(cipherFreqArray[i],engfreqs[j]); bestMatch = j; } } key.put(returnCharFromVal(bestMatch), returnCharFromVal(i)); }