Tower of Hanoi: The Moves — Solution & Editorial
The classic recursion: move N−1 discs to the spare, move the big disc, move the N−1 back on top. The optimal sequence is unique.
Complexity: O(2N)
The classic recursion: move N−1 discs to the spare, move the big disc, move the N−1 back on top. The optimal sequence is unique.
Complexity: O(2N)