“Search” is such a broad term that this entire book could be called Classic Search Problems in Java. This chapter is about core search algorithms that every programmer should know. It does not claim to be comprehensive, despite the declaratory title.
Genes are commonly represented in computer software as a sequence of the characters A, C, G, and T. Each letter represents a nucleotide, and the combination of three nucleotides is called a codon. This is illustrated in figure 2.1. A codon codes for a specific amino acid that together with other amino acids can form a protein. A classic task in bioinformatics software is to find a particular codon within a gene.
package chapter2; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; public class Gene { public enum Nucleotide { A, C, G, T }