


Here’s the hack.Following shows an array of minimum number of moves needed to move all the discs from left corner peg to right corner peg of the tower.Index of the array represent the number of discs.Maximum number of disc is 55. Hard isn’t it? But not impossible.!!There’s a dynamic algorithm to solve it if you are interested you can read this article… Today we are not going to solve Tower of Hanoi problem with 3 pegs or even we are not going to write an algorithm to solve a 4 peg one,which is actually very complex.I’m just giving a hack to tackle problems related to Tower of Hanoi with 4 pegs.If you don’t have any experience in solving 4 pegs one please start now and try that.I just need the number of moves that needed to move a given number of discs. Normally Recursion is used to solve this problem.If you don’t have any knowledge on this please refer in to this article. No disk may be placed on top of a smaller disk.The minimum number of moves required to solve a Tower of Hanoi puzzle is 2^n – 1, where n is the number of disks. a disk can only be moved if it is the uppermost disk on a stack. Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules. The puzzle starts with the disks in a neat stack in ascending order of size on one rod, the smallest at the top, thus making a conical shape. The normal problem consists of three rods, and a number of disks of different sizes which can slide onto any rod. Tower of Hanoi is a classical problem in Computer Science and if you are CS or IT guy/gal you should have heard about it.
