Skip to content

Commit ba8b804

Browse files
committed
fixed chapter 2 mistype using wrong variable; errata
1 parent 82ab599 commit ba8b804

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CCSPiJ/src/chapter2/Gene.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public boolean binaryContains(Codon key) {
7272
int high = sortedCodons.size() - 1;
7373
while (low <= high) { // while there is still a search space
7474
int middle = (low + high) / 2;
75-
int comparison = codons.get(middle).compareTo(key);
75+
int comparison = sortedCodons.get(middle).compareTo(key);
7676
if (comparison < 0) { // middle codon is less than key
7777
low = middle + 1;
7878
} else if (comparison > 0) { // middle codon is greater than key

0 commit comments

Comments
 (0)