# Fast implementation of basic addition algorithm [closed]

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.

## closed as unclear what you're asking by D.W.♦, David Richerby, R B, Nicholas Mancuso, HoopjeDec 29 '14 at 13:09

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

• Do you have some ideas? I'm sure you are able to implement the algorithm somehow; where did you get stuck while trying to make it faster? – Raphael Dec 18 '14 at 21:05

Challenge: show that the average number of steps this algorithm will take on an $m$-digit number represented in base $b$ is less than $b/(b-1)$.