ALL > Computer and Education > courses > university courses > undergraduate courses > An Overview of Computer Science > ZSTU-2016-2017-CLASS > huanglican > 2016329600181李锦程 >
2016329600181李锦程homework5 Version 0
👤 Author: by weiwall617921672sinacom 2016-11-24 19:55:26
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.