I think the right algo for 2.1.4 is with C[i] = A[i] + B[i] + r.
Current solution shift binary operation to the left and final operation overwrite C[n+1] = A[n] + B[n] + r with C[n+1] = r
Thanks. Actually, I found other mistakes led by https://github.com/walkccc/CLRS/pull/444 since I overlooked that the solution already states that "least-significant digit first". Will redo this problem.
Hello there,
I think the right algo for 2.1.4 is with
C[i] = A[i] + B[i] + r
. Current solution shift binary operation to the left and final operation overwriteC[n+1] = A[n] + B[n] + r
withC[n+1] = r