1. Engineering
  2. Computer Science
  3. code in c which will work on tower of hanoi...

Question: code in c which will work on tower of hanoi...

Question details

Code in C++ which will work on Tower of Hanoi with 4 Pegs(Towers) using Frame and Steware Fornula e.g

First move upper k from A to B with the help of C & D

Rest move from A to D with the help of C

Last move k from B to D with help of A & C  

k= ⌊(√(8 n + 1 ) - 1)/2⌋

MS(Mimimum steps)=[n-(K^2 (n)-K+2)/2] 2^(k)+1

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution