Fast implementation of basic addition algorithm Write code for a modified version of the Grade School addition algorithm that adds the integer one to an m-digit integer. Thus, this modified algorithm does not even need a second number being added. Design the algorithm to be fast, so that it avoids doing excessive work on carries of zero.


I encountered this question looking over last year's final for my algorithms course. I'm not really sure how to answer it, although it seems like it isn't a very challenging question.
In a positional number system, there is one highest digit; every other has a successor in the set of digits. At the (low-significant) end of the sequence of digits (the integer's representation), there is either one of those other digits, or a sequence of that highest one.