By making use of recursion, we can multiply two integers with the given constraints.
To multiply x and y, recursively add x y times.
Time Complexity: O(y) where y is the second argument to function multiply().
Please write comments if you find any of the above code/algorithm incorrect, or find better ways to solve the same problem.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Write you own Power without using multiplication(*) and division(/) operators
- Divide two integers without using multiplication, division and mod operator | Set2
- Russian Peasant (Multiply two numbers using bitwise operators)
- Find Quotient and Remainder of two integer without using division operators
- Check if a number is divisible by 8 using bitwise operators
- How to sum two integers without using arithmetic operators in C/C++?
- Multiply large integers under large modulo
- Find subsequences with maximum Bitwise AND and Bitwise OR
- Median in a stream of integers (running integers)
- Multiply two polynomials
- Efficient way to multiply with 7
- Multiply the given number by 2 such that it is divisible by 10
- Program to multiply two matrices
- Multiply perfect number
- Division without using '/' operator
- DFA based division
- Modular Division
- Multiply N complex numbers given as strings
- Sum of division of the possible pairs for the given Array
- Trick for modular division ( (x1 * x2 .... xn) / b ) mod (m)