Question

Problem 2 (9 pts.)

Recall the toBinary algorithm from Tutorial 7 problem 3, which finds the binary representation of a given integer n ≥ 0. For example, toBinary (13) = (1, 1,0, 1), and 1-23 +1-22 +0-2¹ +1-20 = 8+4+0+1 = 13.

Question image 1Question image 2