注册一亩三分地论坛,查看更多干货!
您需要 登录 才可以下载或查看附件。没有帐号?注册账号
x
谁能给解释下这题什么意思
- [size=9.000000pt]In the classic problem of the Towers of Hanoi, you have 3 rods and N disks of differentsizeswhichcanslideontoanytower Thepuzzlestartswithdiskssortedinascendingorder of size from top to bottom (e g , each disk sits on top of an even larger one) Youhave the following constraints:
[size=9.000000pt](A) Only one disk can be moved at a time
[size=9.000000pt](B) A disk is slid off the top of one rod onto the next rod
[size=9.000000pt](C) A disk can only be placed on top of a larger disk
[size=9.000000pt]Write a program to move the disks from the first rod to the last using Stacks
|