Consider the problem of adding two binary integers and b, stored in two n-element arrays and , where each element is either 0 or 1, and . The sum of the two integers should be stored in binary form in an (n + 1)-element array C[0:n], where .
Write a procedure ADD-BINARY_INTEGERS that takes as input arrays and along with the length n, and returns array holding the sum.