Multiplying two n digit numbers, where multiplication of two 1 digit numbers is O(1), is : O(n^2).
On Sat, Jul 31, 2010 at 9:12 PM, Dave <[email protected]> wrote: > 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 <[email protected]> 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 [email protected]. > To unsubscribe from this group, send email to > [email protected]<algogeeks%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > > Please access the attached hyperlink for an important electronic communications disclaimer: http://dce.edu/web/Sections/Standalone/Email_Disclaimer.php -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/algogeeks?hl=en.
