viterbi algorithm

finish viterbi algorithm and related example