In fact I spent on the order of half an hour playing with the OP's code, but I couldn't figure out what a useful starting condition might be. Revisiting the OP's node I've only just noticed the print "\n\n", viterbi(end, 3); at the end of the large code block. I guess I was misled by the comment 'this part is main part' following the first code fragment into thinking that was the driving code for what followed rather than the 'key part of the code' as, in hind sight, the OP presumably meant. On reflection it's not surprising that my static analysis of the code wasn't getting anywhere fast!
Bottom line? 'Don't attribute to malice what you can account for by stupidity!'
In reply to Re^3: how can i hold temporary values in a recursive function
by GrandFather
in thread how can i hold temporary values in a recursive function
by siskos1
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |