第一篇文章就写说一下数据结构相关吧**
hanoi问题
void hanoi (int n, char a, char b, char c) {
//n 为要移动的塔的层数
// a is source , c is destination , b is the middle .
// presume the method void move(x, n ,z) is the movement from x to z. , n is the NO. n floor of the spire.
if (n == 1){
move (x, 1, z};
}else {
hanoi ( n - 1, x, z, y); //entry
move (x, n, z); //exit of the recursion
hanoi (n -1, y, x, z); //entry2
}
}