| |
| | CS154, Assignment 8, Problem 1 Solution (Site not responding. Last check: 2007-11-01) |
 | | This machine requires just n+1 steps to convert the input string, so the asymptotic time complexity is O(n), where n is the number of digits in the input string. |
 | | By counting steps in the Turing machine above, we see that numbers that overflow take 4n+3 steps to convert, whereas numbers that do not overflow take just 2n+1 steps to convert. |
 | | In both cases, then, the asymptotic time compexity is O(n), where n is the number of digits in the input string. |
| graphics.stanford.edu /~dk/cs154.html (282 words) |
|