 multiply(a[1..p], b[1..q], base) // Operands containing rightmost digits at index 1

Let "n" be the total number of digits in the two input numbers in base "D".If the result must be kept in memory then the space complexity is trivially Θ("n").However, in certain applications, the entire result need not be kept in memory and instead the digits of the result can be streamed out as they are computed (for example, to system console or file).