Algorithms, Dynamic Programming, Machine Learning, Artificial Intelligence, Markov Models.
algorithm requires O(T×S) space, where T is the number of observations and S is the number of possible states. We have to solve all the subproblems once, and each subproblem requires iterating over all S possible previous states. Thus, the time complexity of the Viterbi algorithm is O(T×S²).