Please Visit: http://ift.tt/1ajReyV
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pYhBHq
via LifeLong Community
Russian Peasant Multiplication | GeeksforGeeks
Given two integers, write a function to multiply them without using multiplication operator.
There are many other ways to multiply two numbers (For example, see Russian peasant algorithm (Link->http://ift.tt/1nugx9d) . The idea is to double the first number and halve the second number repeatedly till the second number doesn’t become 1. In the process, whenever the second number become odd, we add the first number to result (result is initialized as 0)
http://ift.tt/1pYhDz3
http://ift.tt/1nugx9f
Given two integers, write a function to multiply them without using multiplication operator.
There are many other ways to multiply two numbers (For example, see Russian peasant algorithm (Link->http://ift.tt/1nugx9d) . The idea is to double the first number and halve the second number repeatedly till the second number doesn’t become 1. In the process, whenever the second number become odd, we add the first number to result (result is initialized as 0)
http://ift.tt/1pYhDz3
http://ift.tt/1nugx9f
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1pYhBHq
via LifeLong Community
No comments:
Post a Comment