The cost of a sequence S of size n of operations of type insert, performed
on an initially empty arraylist is given by: cost(S) = cost copy(S) + cost ins(S) We analyse cost copy(S). We observe that: 2k1 < n 2k for some k N. Moreover, k represents the number of times the arraylist capacity was doubled. It follows that: k 1 < log(n) k, and thus k = dlog(n)e. The cost of the ith doubling is 2i1 , hence: dlog(n)e