Monday, 4 July 2016

Tower of Hanoi Implementation in Java

Towers_Of_Hanoi_Figure.jpg

Tower of Hanoi is a mathematical puzzle. It is also known as Tower of Brahma or Locus' Tower. This puzzle consist of three rods in which disks can slide.

There are some number of disks are placed on a rod in increasing order of their disk size form top to bottom. Now we have to transfer all the disk to another rod. Keeping in mind that.

  1. Only one disk can be moved at a time.

  1. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.

  1. No disk may be placed on top of a smaller disk.

Read more about Tower of Hanoi Implementation in Java visit Findnerd.

No comments:

Post a Comment