First characterize the running time of Algorithm D using a summation.