Implementation of the Viterbi algorithm for the CS161 midterm assignment, using dynamic programming.