Show that Algorithm 4 uses O(q log a) bit operations, assuming that a > d.

Solution:Step 1:The answer to this question we have to show that the number of bit operations used by algorithm is O(q loga).Step 2:In Given algorithm:The most time consuming part of the algorithm is below while loop.Procedure division algorithm (a: integer, d: positive integer)q :=0r := While r r := r-dq := q+1If a < 0 and r >0 thenr := d-rq := -(q+1)Return (q,r) {q =a div d is the quotient , r = a mod d is the remainder}Step 3:In this algorithm, only time-consuming part is:While r r := r-dq := q+1End while