Question: 3 Big - Analysis: Algorithms on Numbers Let and be two nonnegative integers, represented in binary. Assume for concreteness that there are no leading zero
Big Analysis: Algorithms on Numbers
Let and be two nonnegative integers, represented in binary. Assume for concreteness
that there are no leading zeros in the binary representations; for example the number three
is represented as and not as If you prefer, you can assume that the numbers are
represented in decimal and answer the problem for decimal addition and division operations,
it wont change the answer.
Addition. A standard algorithm for adding and produces the sum by working
from loworder bits to highorder bits of each number. A carry bit is initially set to
The algorithm iteratively produces an output bit from the carry and two bits of and
or just one of these if all bits of the other have already been considered and updates
the carry. Once all bits of and are considered, if the carry is then a final highorder
is output.
a marks Give a tight big bound on the running time of this algorithm as a
function of and Justify your answer. You may assume that you can access the
bits of the numbers in constant time ie you can get the value of the th bit for
any
b marks Which categories does the running time of the standard addition algorithm
belong to Choose as many as apply. Your justification for your choices need
not consider all options separately; may be able to justify your choices across a
row with one sentence, using facts that you already know about the growth of
functions.
log log log log
log log log log
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
