Question: I need a working jsfiddle . The HTML and Javascript need to be separate please make sure it works before answering. Assignment We are going
I need a working jsfiddle . The HTML and Javascript need to be separate please make sure it works before answering.
Assignment
We are going to solve the classic Tower of Hanoi. Using the Wikipedia article I want you to write a computer program that calculates the number of moves necessary to solve Tower of Hanoi given a number of disks. There are formulas that calculate this - you are NOT going to use them. You will calculate this by implementing the recursive algorithm of the tower and counting every time a block is moved. You may also want to print out the moves. Also I recommend not allowing input greater that 7 blocks - it starts getting pretty big after that.
This can easily be implemented by using your Stack from previous assignments - all you really do in this is push and pop from the stack.
Answer the following questions in the interface of your code;
1. What is the Complexity (In Big O)?
2. Should we be concerned with concerned with the legend of the world ending when the 64 disk solution is physically solved it it takes 2 seconds for each move?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
