Hidden Markov models (Viterbi and posterior decoding)

The answer to the HMM exercise can be found at

viterbi_ans.c
posterior_ans.c