This question evaluates understanding of recursion, algorithmic problem decomposition, and analysis of time complexity when generating constrained move sequences.
You are given n disks of different sizes stacked on peg A (largest at bottom). You have two other pegs, B and C. You may move one disk at a time, and you may never place a larger disk on top of a smaller disk.
Write a program that outputs a valid sequence of moves to transfer all disks from A to C. Define the move format (e.g., "A -> C"). Analyze the time complexity.