A[0] is the low-order bit.
A[k-1] is the high-order bit.
Increment(A) i = 0 while i < length(A) and A[i] = 1 A[i] = 0 i = i+1 if i < length(A) then A[i] = 1