If by "repeated addition method," you mean

m + m + m + ... + m (where m occurs k times)

for forming the product k*m, then the work of forming k*m where k and
m are n digit numbers is O((k-1)*n).

Using the elementary school algorithm, the work can be reduced to
O(n^2).

See http://en.wikipedia.org/wiki/Multiplication_algorithm for even
faster algorithms.

Dave

On Jul 31, 7:58 am, sourav <souravs...@gmail.com> wrote:
> When you first learned to multiply numbers, you were told that x * y
> means adding x a total of y times, so 5 * 4 = 5+5+5+5 = 20. What is
> the time complexity of multiplying two n-digit numbers in base b using
> the repeated addition method, as a function of n and b. Assume that
> single-digit by single-digit addition or multiplication takes O(1)
> time.
>
> Show how you arrive at your answer.
>
> (Hint that was given : "how big can y be as a function of n and b?")

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to