ALL > Computer and Education > courses > university courses > undergraduate courses > An Overview of Computer Science > ZSTU-2016-2017-CLASS > huanglican >
Homework-5 曾治历 Version 0
👤 Author: by benedict 2016-11-28 15:56:49
40.procedure hanoi(n,x,y,z):
if n=1,print(x"->"z);
else hanoi(n-1,x,z,y);
print(x"->"z);
hanoi(n-1,y,x,z);
hanoi(n,"x","y","z");
41.A->Array[];
for(i=1,i<=n,i++):
if(i%2==0)Array[i]:
case:A {print(A->C)}C->Array[i]}
case:B{print(B->A)}A->Array[i]}
case:C {print(C->B)}

Please login to reply. Login

Reversion History

Loading...
No reversions found.