In Section 2.1 we described an algorithm that multiplies two $n$ -bit binary integers $x$ and $y$ in time $n^{a},$ where $a=\log _{2} 3 .$ Call this procedure fastmultiply $(x, y)$.
(a) We want to convert the decimal integer $10^{n}$ (a 1 followed by $n$ zeros) into binary. Here is the algorithm (assume $n$ is a power of 2 ):
Fill in the missing details. Then give a recurrence relation for the running time of the algorithm, and solve the recurrence.
(b) Next, we want to convert any decimal integer $x$ with $n$ digits (where $n$ is a power of 2 ) into binary. The algorithm is the following:
Here binary[.] is a vector that contains the binary representation of all one-digit integers. That is, binary[0] $=0_{2},$ binary $[1]=1_{2},$ up to binary $[9]=1001_{2} .$ Assume that a lookup in binary takes $O(1)$ time. Fill in the missing details. Once again, give a recurrence for the running time of the algorithm, and solve it.