TheAlgorithms/C++ 1.0.0
All the algorithms implemented in C++
|
Solve the Tower of Hanoi problem. More...
#include <iostream>
Go to the source code of this file.
Classes | |
struct | tower |
Functions | |
void | show (const struct tower *const F, const struct tower *const T, const struct tower *const U) |
void | mov (tower *From, tower *To) |
void | TH (int n, tower *From, tower *Using, tower *To) |
int | main () |
Solve the Tower of Hanoi problem.
Definition in file tower_of_hanoi.cpp.
int main | ( | void | ) |
Main function
Definition at line 65 of file tower_of_hanoi.cpp.
Move one disc from one tower to another
[in,out] | From | tower to move disk from |
[in,out] | To | tower to move disk to |
Definition at line 39 of file tower_of_hanoi.cpp.
Display the towers
Definition at line 19 of file tower_of_hanoi.cpp.
Recursive algorithm to solve the puzzle
[in] | n | starting number of disks |
[in,out] | From | tower to move disks from |
[in,out] | Using | temporary tower for the puzzle |
[in,out] | To | tower to move disk to |
Definition at line 52 of file tower_of_hanoi.cpp.