Asymptotic Analysis & Recurrences

Your answer
Answer & solution
Official answer: D
To move n discs, first move the top n−1 discs to the spare peg, move the largest disc once, then move those n−1 discs onto it. These two subproblems cannot be avoided in an optimal solution. Thus T(n)=2T(n−1)+1 with T(0)=0, yielding 2n−1 moves. Hence D.
Check: The largest disc cannot move until all n−1 smaller discs are off it, and afterward those smaller discs must be transferred onto it. With T(1)=1, the recurrence yields T(2)=3 and T(3)=7, consistent with 2n−1.