algorithm to do arbitrary precision addition using linked lists: L1: list addend L2: list addend L3: list sum finds out which list has more digits (list.size()) L1_index= L1.size()-1 L2_index= L2.size()-1 make list L2 the longer of the two lists - swap if necessary carry=0; while L1_index>=0 { //L1 is shorter new_digit= L1[L1_index] + L2[L2_index] + carry if new_digit<10 insert new_digit in sum, set carry =0 else insert (new_digit%10) in sum, set carry=1 Decrement L1_index Decrement L2_index } 4 cases now: L2_index<0, carry=0: do nothing L2_index<0, carry=1: insert 1 in sum list. L2_index>=0, carry=0: insert remaining digits in L2 into sum L2_index>=0, carry=1: let x=next digit in L2 + carry. If x is <10 insert in sum, set carry=0, and insert remaining digits of L2 into sum. if x>=10, insert x%10 into sum, and repeat for next digit with carry =1. When L2_index<0,if carry still = 1, insert 1 into result.