If I understand your algorithm correctly, it seems O(n^2)
where n
is the number of digits.
Have you looked at Karatsuba Algorithm?
It speeds up multiplication using the divide and conquer approach. It may be worth taking a look at.
More Related Contents:
- find the number of times a character occurs between two indexes
- Program to find sum of prime numbers between 1 and 10^7
- Algorithm (especially for c++) to show Every Permutation
- Random generation of numbers? [closed]
- How to implement big int in C++
- Sorting zipped (locked) containers in C++ using boost or the STL
- What is the fastest way to transpose a matrix in C++?
- Why will std::sort crash if the comparison function is not as operator
- Finding all the subsets of a set
- Efficient implementation of log2(__m256d) in AVX2
- std::transform() and toupper(), no matching function
- C++ string::find complexity
- C++: Converting Hexadecimal to Decimal
- Printing prime numbers from 1 through 100
- Circular lock-free buffer
- Generating m distinct random numbers in the range [0..n-1]
- Special simple random number generator
- TMP: how to generalize a Cartesian Product of Vectors?
- Efficiently getting all divisors of a given number
- How can std::make_heap be implemented while making at most 3N comparisons?
- Writing a simple equation parser
- What is the right approach when using STL container for median calculation?
- Howto create combinations of several vectors without hardcoding loops in C++?
- Ways to do modulo multiplication with primitive types
- Removing ‘#include ‘ doesn’t break the code
- Is it possible to map string to int faster than using hashmap?
- Is it possible to implement lock free map in C++
- stl ordering – strict weak ordering
- Calculate mean and standard deviation from a vector of samples in C++ using Boost
- Checking if all elements of a vector are equal in C++