/Integer-multiplication-algorithm

Integer multiplication algorithm - from Algorithm Illuminated Part I Basics. This python program calculates the number of steps of a normal long multiplication process done by a human. Hence this process doesn

Primary LanguagePython

Integer-multiplication-algorithm

Integer multiplication algorithm - from Algorithm Illuminated Part I Basics. Put the biggest number as x and smallest number as y to get result. This python program is inspired by the Stanford course on Algorithm Illuminated and calculates the number of steps of a normal long multiplication process done by a human. Hence this process doesn't include, for intsance, 5678 * 1234, the addition of zeros when adding the product of 5678* 30 and 5678*200 and etc. It mimics the normal process of a normal human being when calculating the product of 2 integers.

Each basic operation is: add/multiply 2 single digit integer. Hence the result of this program gives the total number of these basic operations.